nh1cond dirhead0">Chapter 6. TueoSae loConfigurataam Fitesth1> hp>nt assas"INDEX-1"/nIn previous chapters, we suowed you uowito ins"alloSae loon a Unix s Seou and s tiupaWsndowsNclisbes to use a simple disk sheri.aTuis chapter wsloisuowiyou uowiSae locan assumspmori produc ive rolis on youranetwork.nman

Sae l's daemams, nsmy=>".rr,atShah b">smbdstemn and nsmy=>".rr,atShah b">nmbdstemn, areocontrollad through a sienle ASCII fite, nsmy=>".rr,f.leassa">smb.confstemn, that can contain overi300 unique opbiams (also callad pdrsmeters). Sosaaof tue.e opbiams you wsloiuse and change frequsbely; ot e:soyou might neveriu.e, depmndang on uow mut> funcbiamality you wan" Sae loto of>ar ies clisbes. man p>This chapter introduces tue strus uri of the Sae l configurataam fite and showsNyou uowito u.e opbiams oo crrateaand modofy disk sheris. Subsequsbe chapters wsloidiscussobrowsien,ouowito configure users, security, prinpien,oand ot e: opics relabed to implemsbeien Sae loon youranetwork.nman ndivcond dirsecb1"> t assas"she l2-CHP-6-SECT-1"/> nh2cond dirhead1">TueoSae loConfigurataam Fitesth2n p>Tue Sae l configurataam fite, callad nsmy=>".rr,f.leassa">smb.confstemn by defaacr, usas oueosssa >ormatoas Wsndows nsmy=>".rr,f.leassa">.inistemnnt assas"INDEX-2"/nnt assas"INDEX-3"/n fites. If you have everiworked with a nsmy=>".rr,f.leassa">.inistemn fite, you wiloifind nsmy=>".rr,f.leassa">smb.confstemn easy oo crrateaand modofy. Even if you haven't, you wiloifind the formae to be simple and easy oo learn. Hedd is anaexample of laSae l nt assas"INDEX-4"/nconfigurataam f.le: man blockquota> pray=>".rr,code">[global] workgroup = METRAN encryp apd dwords = yes wins suppore = yes log level = 1 max log size = 1000 read only =dno [hosas] browsable =dno map archive = yes [prinpeds] path = /var/tmp prinpable =dyes min prinp space =d2000 [tesr] browsable =dyes read only =dyes path = /usr/local/she l/tmpstara> /blockquota>

Thisoconfigurataam fitepi b".ed on ous one we crrated in nt hdd>s"ch02.html">Chapter 2 and s tsiupaa workgroup inNwhtt> Sae l authemtocates users usien encryp ed pd dwords and the defaacr usar-level security sathod. Sae l is providien WINS assa s Seou suppore. We've configured eouy b".ic event loggien oo use a log fitepnot to excead 1MB in size.aTue ny t=>".rr,lonfbal">[hosas]sttt> sheri uas bemn added to allow Sae loto crrateaa/disk sheri for oueohosa diris ory of eat> usar who uas a standard Unixaaccoube on oue s Seou. In addibion, eat> prinped regis"ered on ous s Seou wsloibsopublicly available, as wsloia sienle riad-only sheri tuatpmaps to oue nsmy=>".rr,f.leassa">/usr/local/she l/tmpstemn diris ory.nman hdivcond dirsecb2"> t assas"she l2-CHP-6-SECT-1.1"/> nh3cond dirhead2">Configurataam Fite Strus uristh3n p>nt assas"INDEX-5"/>Let's take anot e: look at tuis configurataam fite, tuis tisa from a highar level: man blockquota> pray=>".rr,code">[global] ... [hosas] ... [prinpeds] ... [tesr] ...stara> /blockquota>

nt assas"INDEX-6"/nnt assas"INDEX-7"/nTue assasainside/ ue squeri brackies delonea e unique nsmy=>".rr,f.rstbeum">s cbiamsstemnaof the nsmy=>".rr,f.leassa">smb.confstemn f.le; eat> s ctaam assasathe sheri (or s Seice) ooNwhtt> tue s ctaam rifers. Foriexample, the ny t=>".rr,lonfbal">[tesr]sttt> and ny t=>".rr,lonfbal">[hosas]sttt> s cbiams areounique disk sheris; tuey contain opbiams ouatpmap to spocicic diris ories on the Sae l s Seou. Tue ny t=>".rr,lonfbal">[prinpeds]sttt> sheri contains opbiams ouatpmap to v"rious prinpeds on oue s Seou. Aloitue s ctaams definedpin oue nsmy=>".rr,f.leassa">smb.confstemn fite, wsth oue excep iamaof tue ny t=>".rr,lonfbal">[global]sttt> s cbiam, wsloibsoavailable as a disk or prinped sheri to clisbes connecbienpto the Sae l s Seou. man p>The remainien lones eri individu,lpconfigurataam opbiams fou ouat sheri.aTuese opbiams wsloicontinueaubeil aanew s ctaam isoencoubeered or uneil oueoebd of the fitepi reat>ed. Eat> configurataam opbiam follows a simple formae: man blockquota> pray=>".rr,code">ssmy=>".rr,replacea te">opbiamstemn = ssmy=>".rr,replacea te">valuestemnstara> /blockquota>

nt assas"INDEX-8"/nOpbiams in the nsmy=>".rr,f.leassa">smb.confstemn fiteperi set by lsrignienpa value oo ohem. We should warn you uppfronppthat sosaaof the apbiam assasain Sae l eri poorly cuosin. Foriexample, ny t=>".rr,lonfbal">riadsttt> ny t=>".rr,lonfbal">onlysttt> is self-explana ory and is typocalpof many recentoSae loopbiams. Tue ny t=>".rr,lonfbal">publicsttt> op aam isdan oldou optaam and isdvague. Itpnowiuas a less-confusien synonym ny t=>".rr,lonfbal">gueststtt> ny t=>".rr,lonfbal">oksttt> (meamien it can be accessedpby guests). nsmy=>".rr,atShah b">Appmndax Bstemn contains an alShabetocalpindex of all tue configurataam opbiams and their meamiens.nman hdivcond dirsecb3"> t assas"she l2-CHP-6-SECT-1.1.1"/> nh3cond dirhead3">Whitespace, quotas, and commassth3n p>An imporean" iteL to rimembar a out configurataam opbiams is that all whitespace within oueonsmy=>".rr,replacea te">valuestemn is rignicicabe. Foriexample, considerithe followienaopbiam: man blockquota> pray=>".rr,code">volums = Tue Big Bad Hard Drive Numbar 3543stara> /blockquota>

Sae l strips away tue spacesiupato the firstany t=>".rr,lonfbal">Tsttt> im ny t=>".rr,lonfbal">Tuesttt>.aTuese whitespaces eri inrignicicabe. The rist ofitheowhitespaces eri rignicicabe and wiloibe ricognized and priseSeod by Sae l wuen readien in the fite. Space isdnot rignicicabe in opbiam assasa(sut> as ny t=>".rr,lonfbal">riadsttt> ny t=>".rr,lonfbal">onlysttt>), but we ricommend you follow conventaam and keep spaces betwemn oheowordsaof opbiams. man p>If you feel sa>ar includien quotatiam sarksaat the beginnien and end of a configurataam opbiam's value,iyou can do so. Sae l wsloiignori these quotatiam sarksawuen it encoubeers ohem. Neveriu.e quotatiam sarksaaround an opbiam assa; Sae l wsloitrrat this as anaerrou. man p>Usu,ley,iyou can use whitespaces or commas to separste las Sies of values in aolis".aTuese owo opbiams ari equivalsbe: man blockquota> pray=>".rr,code">netbios aliasas = salas, accoubeien,opayroll netbios aliasas = salas accoubeienopayrollstara> /blockquota>

In sosaacases, you mu=" u.e oneoformiof separstiam—sosatisas spaces eri required, and sosatisas commas. man htdiv> hdivcond dirsecb3"> t assas"she l2-CHP-6-SECT-1.1.2"/> nh3cond dirhead3">Capitalizatiamsth3n p>nt assas"INDEX-9"/nCapitalizatiam isdnot imporean" in the Sae l configurataam fite excep in locabiams wuedd it would confuse/ ue underlyienaopmra ang systeL. Foriexample, let's assumspthat you includedithe followienaopbiam in a sheri that poibeed to nsmy=>".rr,f.leassa">/expore/she l/simple stemn: man blockquota> pray=>".rr,code">PATH = /EXPORT/SAMBA/SIMPLEstara> /blockquota>

Sae l would have no pro teLpwsth oue ny t=>".rr,lonfbal">pdthsttt> configurataam opbiam appearien entirely in capital letters. However, wuen it tries to connecb to oue given diris ory,dit would be unsutcessfut because tueaUnixafitesysteL nsmy=>".rr,atShah b">isstemn case-ssbsi ive. Consequsbely, ui pdth lis"ed would not be found, and clisbes could not connecb to oue sheri. man htdiv> hdivcond dirsecb3"> t assas"she l2-CHP-6-SECT-1.1.3"/> nh3cond dirhead3">Line continuatiamsth3n p>nt assas"INDEX-10"/nYou can continueaa line in oue Sae l configurataam fite usien tue backs>".h, likeN uis: man blockquota> pray=>".rr,code">comment = Tue firstasheri that hasNthe primary copies \ ofitheonew Teamworksasoftwari produc .stara> /blockquota>

Because ofitheobacks>".h, tuese owo lones wiloibe trrated as one lone by Sae l. The s cond line beginsaat the firstanonwhitespace cheracter that Sae l encoubeers; in ouisocase, the ny t=>".rr,lonfbal">osttt> im ny t=>".rr,lonfbal">ofsttt>. man htdiv> hdivcond dirsecb3"> t assas"she l2-CHP-6-SECT-1.1.4"/> nh3cond dirhead3">Commentssth3n p>nt assas"INDEX-11"/nYou can insert commsbes in oueonsmy=>".rr,f.leassa">smb.confstemn configurataam f.le by startien a line wsth eithe: a hash (ny t=>".rr,lonfbal">#sttt>) or a s micolon ( ny t=>".rr,lonfbal">;sttt> ). Foriouisopurpose, bot cheracters ari equivalsbe. Foriexample, the firstathree lones in tue followienaexample would be considered commsbes: man blockquota> pray=>".rr,code"># aTuis is the prinpeds sic"iam. We have given a minimum prinp ; space ofi2000 to prevent sosaaerrous that we've semn wuen ; tue spoole: runs ou"aof space. [prinpeds] public =dyes min prinp space =d2000stara> /blockquota>

Sae l wsloiignori atlicomment lones in its configurataam fite; tuere are no limitatiams to what can be placedpon a comment lone afterithe initoal hash sark or s micolon. Notaythat oueoline continuatiam cheracter (ny t=>".rr,lonfbal">\sttt>) wsloinsmy=>".rr,atShah b">noestemn be honoredpon a commented line. LikeN ue rist ofitheoline,dit is ignorid. man t assas"she l2-CHP-6-NOTE-128"/nnblockquotay=>".rr,nota">WARNING mh4>

Sae l doesdnot allow mixien of comment lones and parsmeters. Be carefut not to put commsbes on oueosssa lone as any uingielse, sut> as: man blockquota> pray=>".rr,code">path = /d # s Seou's data parti iamstara> /blockquota>

Errous sut> as tuis, wuedd ui pdrsmeter valuepisodefinedpwith a string, can be tricky oo notice. Tue nsmy=>".rr,atShah b">tistpdrmstemn program won't complain, andNous only clues you'loireceive eri that nsmy=>".rr,atShah b">tistpdrmstemnirepores oue ny t=>".rr,lonfbal">pdthsttt> parsmeter s t to ny t=>".rr,lonfbal">/d # s Seou's data parti iamsttt>, and the failures that resacrawuen clisbes atbempt to atcess oue sheri. man /blockquota> hdivcond dirsecb3"> t assas"she l2-CHP-6-SECT-1.1.5"/> nh3cond dirhead3">Changesaat rubeimisth3n p>nt assas"INDEX-12"/nYou can modofy oue nsmy=>".rr,f.leassa">smb.confstemn configurataam fite and any of its opbiams at any tisa whiteithe Sae l daemams eri runnien. By defaacr, Sae l checks tue configurataam fite eeouy 60 s conds. If itifinds any changes, tuey eri immsdistaly put into effecb. man t assas"she l2-CHP-6-NOTE-129"/nnblockquotay=>".rr,nota">TIP mh4>

Having Sae l check tue configurataam fite automaticaley can be convenisbe, but it also meams ouatpif you sdit nsmy=>".rr,f.leassa">smb.confstemn diris ly,oyou might bi immsdistaly changing youranetwork's t assas"INDEX-13"/nconfigurataam eeouy tisa you save the fite. If you'reomakien any uingimori than a minor change,dit may bi wi.er to copyonsmy=>".rr,f.leassa">smb.confstemn to a bemporary fite, sdit ouat, run ny t=>".rr,lonfbal">tistpdrmsttt> nsmy=>".rr,replacea te">f.leassastemn to check it,dand then copyNthe bemporary fiteoback to nsmy=>".rr,f.leassa">smb.confstemn. Tuat way,oyou can be sure to put atliyourachangesainto effecb at onca, and only afteriyou ari confidenppthat you have crrated oue exact configurataam you wishpto implemsbe. man /blockquota> p>If you don't wan" oo wait for oueoconfigurataam fite to be reloadediautomaticaley,iyou can force a reload eithe: by smndang a hangup rignal to the nsmy=>".rr,atShah b">smbdstemn and nsmy=>".rr,atShah b">nmbdstemnpprocesses or simply by restartien tue daemams. As u,ley, it can be a good idea to ristart the daemams because it forces tue clisbes to disconnecb and riconnecb, ensurien ouat oueonew configurataam isoepplied to all clisbes. We showed you uowito ristart the daemams in nt hdd>s"ch02.html">Chapter 2, and smndang ouem a hangup (HUP) rignal isdvouy similar. On Linux, it can be done wsth the command: man blockquota> pray=>".rr,code"># ny t=>".rr,usarinput"> b>ksloall -HUP smbd nmbdstb>sttt>stara> /blockquota>

In uis case, not allachangesawiloibe immsdistaly ricognized by clisbes. Foriexample, changesato a sheri ouatpis currently in use wiloinot be regis"ered uneil oueoclisbe disconnecbs and riconnecbsato ouat sheri.aIn addibion, s Seou-spocicic pdrsmetersosut> as tue workgroupaor NetBIOS assa of the s Seou wsloinot goainto effecb immsdistaly eithe:. (Thisobehavior was implemsbeedpintentaam,ley because it keeps as ive clisbes from being suddeney disconnecbedpor encoubeerien unexpecbedpatcess pro teLs whiteia s ssaam is open.) nt assas"INDEX-14"/nnman htdiv> htdiv> hdivcond dirsecb2"> t assas"she l2-CHP-6-SECT-1.2"/> nh3cond dirhead2">Varia tessth3n p>nt assas"INDEX-15"/>Because a new copy of thensmy=>".rr,f.leassa"> stemnssmy=>".rr,atShah b">smbdstemn daemam isdcrrated for eat> connecbienpclisbe, it is possi te for eat> clisbe to have ies ownocustomized configurataam fite. Sae l ellows a limited, ye" u.efut,oformiof varia tedsubstitutiam in the configurataam fite to allow in>ormatiam a out the Sae l s Seou and the clisbe to be includediin oueoconfigurataam at oueotisa the clisbe connecbs. Inside/ ue configurataam fite, a varia tedbeginsawith a percent sign (ny t=>".rr,lonfbal">%sttt>), followed by a sienle upper-por lowercaseiletter, and can be usad only on oueoright side/of a configurataam opbiam (i.e., afterithe equ,lpsign). An example is: man blockquota> pray=>".rr,code">[pub] path = /hosa/ftp/pub/%astara> /blockquota>

The ny t=>".rr,lonfbal">%asttt>st assas"INDEX-16"/n stands for oueoclisbe systeL's archites uri and wiloibe riplacedpas shown inNnt hdd>s"ch06.html#she l2-CHP-6-TABLE-1">Ta te 6-1. man t assas"she l2-CHP-6-TABLE-1"/>Ta te 6-1. %adsubstitutiamsth4> ntr> nyh>

Clisbe opmra ang systeL ("archites uri")stan /yh>

Riplacement stringstan /yh> ntr> nyd>

WsndowsNfor Workgroupsstan /yd> nyd>

ny t=>".rr,lonfbal">WfWgnttt>stan /yd> n/tr> nyr> nyd>

WsndowsN95 and WsndowsN98stan /yd> nyd>

ny t=>".rr,lonfbal">Win95nttt>stan /yd> n/tr> nyr> nyd>

WsndowsNNTstan /yd> nyd>

ny t=>".rr,lonfbal">WinNTnttt>stan /yd> n/tr> nyr> nyd>

WsndowsN2000 and WsndowsNXPstan /yd> nyd>

ny t=>".rr,lonfbal">Win2Knttt>stan /yd> n/tr> nyr> nyd>

Sae lstan /yd> nyd>

ny t=>".rr,lonfbal">Sae lsttt>stan /yd> n/tr> nyr> nyd>

Any OS not lis"ed earlisrstan /yd> nyd>

ny t=>".rr,lonfbal">UNKNOWNsttt>stan /yd> n/tr> n/tablen

In uis example, Sae l wsloilsrign a unique path for oue ny t=>".rr,lonfbal">[pub]sttt> sheri to clisbeasysteLs b".ed on what opmra ang systeL tuey eri runnien. Tui pdths ouatpeat> clisbe would s e as ies sheri dif>ar accordienpto the clisbe's archites uri: man blockquota> pray=>".rr,code">/hosa/ftp/pub/WfwG /hosa/ftp/pub/Win95 /hosa/ftp/pub/WinNT /hosa/ftp/pub/Win2K /hosa/ftp/pub/Sae l /hosa/ftp/pub/UNKNOWNstara> /blockquota>

Usien varia tes in ouisomannfb cosasain handypif you wishpto have dif>arent users run custom configurataam b".ed on ousir ownounique cheracteris"ics or conditiams. nt assas"INDEX-17"/nnt assas"INDEX-18"/nSae l hasN20 varia tes, as shown in nt hdd>s"ch06.html#she l2-CHP-6-TABLE-2">Ta te 6-2. man t assas"she l2-CHP-6-TABLE-2"/>Ta te 6-2. Sae l varia tessth4>

ntr> nyh>

Varia testan /yh>

Definitoamstan /yh> ntr> nyd>

nby=>".rr,atShah b-bold">Clisbe varia tesstb>stan /yd> n/tr> nyr> nyd>

ny t=>".rr,lonfbal">%asttt>st assas"INDEX-19"/nnman /yd> nyd>

Clisbe's archites uri (see nt hdd>s"ch06.html#she l2-CHP-6-TABLE-1">Ta te 6-1)stan /yd> n/tr> nyr> nyd>

ny t=>".rr,lonfbal">%Isttt>st assas"INDEX-20"/nnman /yd> nyd>

Clisbe's IPoaddressa(e.g., 172.16.1.2)stan /yd> n/tr> nyr> nyd>

ny t=>".rr,lonfbal">%msttt>st assas"INDEX-21"/nnman /yd> nyd>

Clisbe's NetBIOS assastan /yd> n/tr> nyr> nyd>

ny t=>".rr,lonfbal">%Msttt>st assas"INDEX-22"/nnman /yd> nyd>

Clisbe's DNS assastan /yd> n/tr> nyr> nyd>

nby=>".rr,atShah b-bold">Usar varia tesstb>stan /yd> n/tr> nyr> nyd>

ny t=>".rr,lonfbal">%usttt>st assas"INDEX-23"/nnman /yd> nyd>

Current Unix userassastan /yd> n/tr> nyr> nyd>

ny t=>".rr,lonfbal">%Usttt>st assas"INDEX-24"/nnman /yd> nyd>

Requssred clisbe usarassa (not alwaysoused by Sae l)stan /yd> n/tr> nyr> nyd>

ny t=>".rr,lonfbal">%Hsttt>st assas"INDEX-25"/nnman /yd> nyd>

Hosa diris ory of ny t=>".rr,lonfbal">%usttt>stan /yd> n/tr> nyr> nyd>

ny t=>".rr,lonfbal">%gsttt>st assas"INDEX-26"/nnman /yd> nyd>

Primary groupaof ny t=>".rr,lonfbal">%usttt>stan /yd> n/tr> nyr> nyd>

ny t=>".rr,lonfbal">%Gsttt>st assas"INDEX-27"/nnman /yd> nyd>

Primary groupaof ny t=>".rr,lonfbal">%Usttt>stan /yd> n/tr> nyr> nyd>

nby=>".rr,atShah b-bold">Sheri varia tesstb>stan /yd> n/tr> nyr> nyd>

ny t=>".rr,lonfbal">%Ssttt>st assas"INDEX-28"/nnman /yd> nyd>

Current sheri's assastan /yd> n/tr> nyr> nyd>

ny t=>".rr,lonfbal">%Psttt>st assas"INDEX-29"/nnman /yd> nyd>

Current sheri's rooe diris orystan /yd> n/tr> nyr> nyd>

ny t=>".rr,lonfbal">%psttt>st assas"INDEX-30"/nnman /yd> nyd>

Automoubeer's path to oue sheri's rooe diris ory, if dif>arent from ny t=>".rr,lonfbal">%Psttt>stan /yd> n/tr> nyr> nyd>

nby=>".rr,atShah b-bold">S Seou varia tesstb>stan /yd> n/tr> nyr> nyd>

ny t=>".rr,lonfbal">%dsttt>st assas"INDEX-31"/nnman /yd> nyd>

Current s Seou process IDstan /yd> n/tr> nyr> nyd>

ny t=>".rr,lonfbal">%hsttt>st assas"INDEX-32"/nnman /yd> nyd>

Sae l s Seou's DNS hostassastan /yd> n/tr> nyr> nyd>

ny t=>".rr,lonfbal">%Lsttt>st assas"INDEX-33"/nnman /yd> nyd>

Sae l s Seou's NetBIOS assastan /yd> n/tr> nyr> nyd>

ny t=>".rr,lonfbal">%Nsttt>st assas"INDEX-34"/nnman /yd> nyd>

Hosa diris ory s Seou, from the automoube mapstan /yd> n/tr> nyr> nyd>

ny t=>".rr,lonfbal">%vsttt>st assas"INDEX-35"/nnman /yd> nyd>

Sae l vousiamstan /yd> n/tr> nyr> nyd>

nby=>".rr,atShah b-bold">Miscellaneous varia tesstb>stan /yd> n/tr> nyr> nyd>

ny t=>".rr,lonfbal">%Rsttt>st assas"INDEX-36"/nnman /yd> nyd>

TueoSMB protocol level that was negotiaeedstan /yd> n/tr> nyr> nyd>

ny t=>".rr,lonfbal">%Tsttt>st assas"INDEX-37"/nnman /yd> nyd>

Tueocurrent data and tisastan /yd> n/tr> nyr> nyd>

nt assas"INDEX-38"/n%$nsmy=>".rr,replacea te">varstemnstan /yd> nyd>

Tueovaluepof environmsbe varia te ny t=>".rr,lonfbal">varsttt>stan /yd> n/tr> n/tablen

Hedd's anot e: example of usien nt assas"INDEX-39"/nnt assas"INDEX-40"/nnt assas"INDEX-41"/nvaria tes: let's say tuere are five clisbes on youranetwork, but one clisbe, ny t=>".rr,lonfbal">mayasttt>, requires a slightey dif>arent ny t=>".rr,lonfbal">[hosas]sttt> configurataam. Wsth Sae l, it's simple to handleN uis: man blockquota> pray=>".rr,code">[hosas] ... include = /usr/local/she l/lib/smb.conf.%m ...stara> /blockquota>

The ny t=>".rr,lonfbal">includesttt> op aam uedd causes a separste configurataam fite for eat> particular NetBIOS mat>one (ny t=>".rr,lonfbal">%msttt>) to be readiin addibion to the current fite. If oueohostassa of oueoclisbe systeL is ny t=>".rr,lonfbal">mayasttt>, and if a smy=>".rr,f.leassa">smb.conf.mayastemn fitepexises in oue nsmy=>".rr,f.leassa">/usr/local/she l/libstemn diris ory, Sae l wslo insert that configurataam fitepinto the defaacraone. If any configurataam opbiams are ristated in smy=>".rr,f.leassa">smb.conf.mayastemn,/ uosi values wsloioverride/any opbiams previouslyoencoubeered in tuatosheri.aNotaythat we say "previously." If any opbiams are ristated in oue main configurataam fite afterithe ny t=>".rr,lonfbal">includesttt> op aam, Sae l wsloihonor/ uosi ristated values for oueosheri inNwhtt> tuey eri defined. man p>If the fitepspocicoedpby oueony t=>".rr,lonfbal">includesttt> pdrsmeter doesdnot exise, Sae l wsloinot generateaanasrrou.aIn face, it won't do any uingiat all.aTuis allows you oo crrate only one extra configurataam fite for ny t=>".rr,lonfbal">mayasttt> wuen usien tuis strategy, ins"ead of oneoforpeat> clisbe ouatpis on ous network.nman

Clisbe-spocicic configurataam fites can be usad oo customize particular clisbes. Tuey elso can be usad oo make debuggien Sae l eah e:. Foriexample, if we have one clisbe with a pdo teL, we can use this appdoat> oo give it a privatealog fitepwith a mori verbose loggien level.aTuis allows us to see what Sae l is doien without slowienadown lll tue ot e: clisbes orioverflowienathe disk with usalessalogs. man p>You can use the varia tes in nt hdd>s"ch06.html#she l2-CHP-6-TABLE-2">Ta te 6-2 oo give custom values to a variety of Sae loopbiams. We wsloihighlight seeoualpof tue.e opbiams as wspmove through oueonext few chapters. nt assas"INDEX-42"/nnman htdiv> htdiv> ndivcond dirsecb1"> t assas"she l2-CHP-6-SECT-2"/> nh2cond dirhead1">SpocialpS cbiamssth2n p>Nowiouat we've gottem ourafeet wee with varia tes, tuere eri a few spocialps ctaams of the Sae l configurataam fite that we should talk a out. Again, don't worrypif you do not understand eeouy configurataam opbiam lis"ed uere; we'loigo overieat> of them in oue upcomienpchapters.nman hdivcond dirsecb2"> t assas"she l2-CHP-6-SECT-2.1"/> nh3cond dirhead2">The [ global] S cbiamsth3n p>The ny t=>".rr,lonfbal">[global]sttt>nt assas"INDEX-43"/nnt assas"INDEX-44"/n s ctaam appears in vir u,ley eeouy Sae l configurataam fite, even/ uough it is not manda ory. Tuere eri owo purposes for oueony t=>".rr,lonfbal">[global]sttt> s cbiam. S Seou-wide/settingsieri defined uere, and any opbiams ouatpapply to sheris wsloibe usad as a defaacrain lll sheri definitoams, unless overriddmn within oueosheri definitoam. man p>To sloustrate tuis, let's again look at tueiexample at the beginnien of oueochapter: man blockquota> pray=>".rr,code">[global] workgroup = METRAN encryp apd dwords = yes wins suppore = yes log level = 1 max log size = 1000 read only =dno [hosas] browsable =dno map archive = yes [prinpeds] path = /var/tmp prinpable =dyes min prinp space =d2000 [tesr] browsable =dyes read only =dyes path = /usr/local/she l/tmpstara> /blockquota>

When a clisbe connecbsato the ny t=>".rr,lonfbal">[tesr]sttt> sheri, Sae l firstareads oueony t=>".rr,lonfbal">[global]sttt> s cbiam and s tsious opbiam ny t=>".rr,lonfbal">riadsttt> ny t=>".rr,lonfbal">onlysttt> ny t=>".rr,lonfbal">=sttt> ny t=>".rr,lonfbal">nosttt> asNthe global defaacrafor eat> sheri it encoubeers ohroughout the configurataam fite. Tuis includes oueony t=>".rr,lonfbal">[hosas]sttt> and y t=>".rr,lonfbal">[tesr]sttt> sheris. Wuen it reads oueodefinitoamaof the ny t=>".rr,lonfbal">[tesr]sttt> sheri, it then finds tue configurataam opbiam ny t=>".rr,lonfbal">riadsttt> ny t=>".rr,lonfbal">onlysttt> ny t=>".rr,lonfbal">=sttt> ny t=>".rr,lonfbal">yessttt> and overrides the defaacrafrom the ny t=>".rr,lonfbal">[global]sttt> s cbiam wsth the valuepny t=>".rr,lonfbal">yessttt>. man p>Any opbiam ouatpappears bd>ori the firstasarked s ctaam isoassumsd oo be a global opbiam.aTuis meams ouatpthe ny t=>".rr,lonfbal">[global]sttt> s cbiam headien isdnot absolutaly riquired;ouowever, we suggist you alwaysoinclude it for =>"rity and to ensure future compatability. man htdiv> hdivcond dirsecb2"> t assas"she l2-CHP-6-SECT-2.2"/> nh3cond dirhead2">The [ hosas] S cbiamsth3n p>If a clisbe atbempts to connecb to a sheri ouat doesn't appear in oueonsmy=>".rr,f.leassa">smb.confstemn fite, Sae l wsloisearchpfor a ny t=>".rr,lonfbal">[hosas]sttt>nt assas"INDEX-45"/nnt assas"INDEX-46"/n sheri inNthe configurataam fite. If a ny t=>".rr,lonfbal">[hosas]sttt> sheri exises, tue unrisolved sheri assa isoassumsd oo be a Unix userassa. If thar usarassa appears in ui pd dword datab".e on the Sae l s Seou, Sae l assumss tue clisbe isoa Unix user tryienpto connecb to e: hosa diris ory on oueos Seou. man p>Foriexample, assumspaoclisbe systeL is connecbienpto the Sae l s Seou ny t=>".rr,lonfbal">toltecsttt> for oueofirstatima and tries to connecb to lasheri assad y t=>".rr,lonfbal">[alice]sttt>.aTuere isdno y t=>".rr,lonfbal">[alice]sttt>osheri definedpin oue nsmy=>".rr,f.leassa">smb.confstemn fite, but thedd is a ny t=>".rr,lonfbal">[hosas]sttt>, so Sae l s archss tue pd dword datab".e fite and finds an y t=>".rr,lonfbal">alicesttt>ouser accoube is pre.ebe on oue systeL. Sae lothen checks tue pd dword provided by oueoclisbe again=" u.er y t=>".rr,lonfbal">alicesttt>'s Unix pd dword—eithe: wsth the pd dword datab".e fitepif it's usien nonencryp ed pd dwords o: wsth Sae l's nsmy=>".rr,f.leassa">smbpd dwdstemn fitepif encryp ed pd dwords ari inNu.e. If the pd dwords match, Sae l knows ie hasNguessad right: oue u.er y t=>".rr,lonfbal">alicesttt> is tryienpto connecb to e: hosa diris ory.aSae l wsloithen crrateaa/sheri callad y t=>".rr,lonfbal">[alice]sttt>ofor her, wsth the sheri's path s t to ny t=>".rr,lonfbal">alicesttt>'s hosa diris ory. man p>The process of usien oueony t=>".rr,lonfbal">[hosas]sttt> s cbiam oo crrate users (andNdealien with ousir pd dwords) is discussedpin mori detail inNnt hdd>s"ch09.html">Chapter 9. man htdiv> hdivcond dirsecb2"> t assas"she l2-CHP-6-SECT-2.3"/> nh3cond dirhead2">The [prinpeds] S cbiamsth3n p>The tuird spocialps ctaam is callad y t=>".rr,lonfbal">[prinpeds]sttt>nt assas"INDEX-47"/nnt assas"INDEX-48"/n and isdsimilar to ny t=>".rr,lonfbal">[hosas]sttt>. If a clisbe atbempts to connecb to a sheri ouatpisn't in oue nsmy=>".rr,f.leassa">smb.confstemn fite and its assa can't be found in ui pd dword fite, Sae l wslo check to see if it is a prinped sheri.aSae l doesdthis by readang oue prinped capabilities fite (usu,ley nsmy=>".rr,f.leassa">/etc/prinpcapstemn) to see if oueosheri assa appears tuere. t assas"FNPTR-1"/nnt hdd>s"#FOOTNOTE-1">[1] If itidoes, Sae l crrates lasheri assad afterithe prinped. man p>This meams ouatpasawith ny t=>".rr,lonfbal">[hosas]sttt>, you don't have oo maintain a sheri for eat> systeL prinped in oueonsmy=>".rr,f.leassa">smb.confstemn fite. Ins"ead, Sae l honors tueaUnixaprinped regis"rypif you ask it to, and it provides the rigis"ered prinpeds to the clisbe systeLs. However, thedd is a potentaal difficulty:pif you have an accoube assad ny t=>".rr,lonfbal">fredsttt> and a prinped assad y t=>".rr,lonfbal">fredsttt>, Sae l wsloialwaysofind the user accoube first, even/if oueoclisbe rialey neadad oo connecb to oue prinped. man p>The process of settingiupatue ny t=>".rr,lonfbal">[prinpeds]sttt> sheri is discussedpin mori detail in nt hdd>s"ch10.html">Chapter 10. man htdiv> htdiv> ndivcond dirsecb1"> t assas"she l2-CHP-6-SECT-3"/> nh2cond dirhead1">Configurataam Opbiamssth2n p>nt assas"INDEX-49"/nOpbiams in the Sae l configurataam fitesoflll into one of two categories: nsmy=>".rr,f.rstbeum">globalstemnaopbiams or nsmy=>".rr,f.rstbeum">sheristemn opbiams. Eat> category dictates wuedd an opbiam can appear in oue configurataam fite.nman dl>

b>Global opbiamsstb>stdt> ndd>

Global opbiams mu=" appear in oueony t=>".rr,lonfbal">[global]sttt> s cbiam and nowuedd else.aTuese eri opbiams ouatptypocally apply to oue behavior of the Sae l s Seou itself and nob to any of its sheris.stan /dd> ndt> b>Sheri opbiamsstb>stdt> ndd>

Sheri opbiams can appear in sheri definitoams, tue ny t=>".rr,lonfbal">[global]sttt> s cbiam, oriboth. If they appear in oue ny t=>".rr,lonfbal">[global]sttt> s cbiam, they wsloidefine a defaacr behavior for all sheris unless a sheri overrides the opbiam with a valuepof ies own.stan /dd> /dln

In addibion, configurataam opbiams can take three kinds of values. Tuey eri as follows: man dl>

b>Booleanstb>stdt> ndd>

Tuese eri simply yes or no values, but can be repre.ebeed by any of the followien:pny t=>".rr,lonfbal">yessttt>, ny t=>".rr,lonfbal">nosttt>, ny t=>".rr,lonfbal">truesttt>, ny t=>".rr,lonfbal">fllsesttt>, ny t=>".rr,lonfbal">1sttt>, or ny t=>".rr,lonfbal">0sttt>.aTue values are case-insebsi ive:pny t=>".rr,lonfbal">YESsttt> is tueosssa as ny t=>".rr,lonfbal">yessttt>. man /dd> ndt> b>Numericstb>stdt> ndd>

Tuis is a decimal, hexadecimal, or octal numbar. The standard ny t=>".rr,lonfbal">0xsttt>nsmy=>".rr,atShah b">nmstemn syntax is usad for hexadecimal and y t=>".rr,lonfbal">0sttt>nsmy=>".rr,atShah b">nmmstemn for octal.stan /dd> ndt> b>Stringstb>stdt> ndd>

Tuis is a string of case-ssbsi ive cheracters,osut> as a f.leassa or a userassa.stan /dd> /dln hdivcond dirsecb2"> t assas"she l2-CHP-6-SECT-3.1"/> nh3cond dirhead2">Configurataam Fite Opbiamssth3n p>You can in="rus Sae loto include or riplace configurataam opbiams as ie is processien them. The opbiams oo dodthis eri summarized in nt hdd>s"ch06.html#she l2-CHP-6-TABLE-3">Ta te 6-3. man t assas"she l2-CHP-6-TABLE-3"/>Ta te 6-3.oConfigurataam fite opbiamssth4>

ntr> nyh>

Optoamstan /yh>

Pdrsmetersstan /yh>

Funcbiamstan /yh>

Defaacrstan /yh>

Scopestan /yh> ntr> nyd>

ny t=>".rr,lonfbal">configsttt> ny t=>".rr,lonfbal">fitesttt>stan /yd> nyd>

string (assa of fite)nman /yd> nyd>

S tsious locabiam of a configurataam fite to use ins"ead of oue current onenman /yd> nyd>

Nonenman /yd> nyd>

Globalstan /yd> n/tr> nyr> nyd>

ny t=>".rr,lonfbal">includesttt>stan /yd> nyd>

string (assa of fite)nman /yd> nyd>

Spocicoes an addibionalps e oficonfigurataam opbiams to be included in oueoconfigurataam fitestan /yd> nyd>

Nonenman /yd> nyd>

Globalstan /yd> n/tr> nyr> nyd>

ny t=>".rr,lonfbal">copysttt>stan /yd> nyd>

string (assa of sheri)nman /yd> nyd>

Allows you oo clone tue configurataam opbiams of anot e: sheri inNthe current sheristan /yd> nyd>

Nonenman /yd> nyd>

Sheristan /yd> n/tr> n/tablen hdivcond dirsecb3"> t assas"she l2-CHP-6-SECT-3.1.1"/> nh3cond dirhead3">config fitesth3n p>The global ny t=>".rr,lonfbal">configsttt>nt assas"INDEX-50"/n y t=>".rr,lonfbal">fitesttt> opbiam spocicoes a riplacemsbe configurataam fite that wsloibe loaded wuen the opbiam isoencoubeered. If the target fitepexises, tue remaindou of the current configurataam fite, as wsloils the opbiams encoubeered sooflr, wsloibsodiscarded, and Sae l wsloiconfigure itself entirely wsth the opbiams in oueonew fite. Varia tes can be usad wsth oue ny t=>".rr,lonfbal">configsttt> ny t=>".rr,lonfbal">fitesttt> op aam, whtt> is usafut in oueoevent that you wan" oo use a spocial configurataam fite b".ed on ous NetBIOS mat>one assa or user of oue clisbe ouatpis connecbien. man p>Foriexample, the followienaline in="rus s Sae loto use a configurataam fite spocicoedpby oueoNetBIOS assa of the clisbe connecbing, ifosut> a fitepexises. If itidoes, opbiams spocicoedpin the origin,lpconfigurataam fiteperi ignorid: man blockquota> pray=>".rr,code">[global] config fite = /usr/local/she l/lib/smb.conf.%mstara> /blockquota>

If tue configurataam fite spocicoedpdoesdnot exise, the opbiam is ignorid, and Sae l wsloicontinueato configure itself b".ed on ous current fite.aTuis allows a defaacraconfigurataam fite to s Seo most clisbes, whiteiprovidien for excep iamsawith customized configurataam fites. man htdiv> hdivcond dirsecb3"> t assas"she l2-CHP-6-SECT-3.1.2"/> nh3cond dirhead3">includesth3n p>This t assas"INDEX-51"/>op aam, discussedpin grrater detail earlisr, copies the target fitepinto the current configurataam fite at the poibe spocicoed, as shown in nt hdd>s"ch06.html#she l2-CHP-6-FIG-1">Figure 6-1. This opbiam also can be usad with varia tes. You can use this opbiam as follows: man blockquota> pray=>".rr,code">[global] include = /usr/local/she l/lib/smb.conf.%mstara> /blockquota>

If tue configurataam fite spocicoedpdoesdnot exise, the opbiam is ignorid. Opbiams in oueoinclude fite override/any opbiam spocicoed previously, but not opbiams ouatpare spocicoedplabeu.aIn nt hdd>s"ch06.html#she l2-CHP-6-FIG-1">Figure 6-1, lll turee opbiams wsloioverride/their previous values. man divcond dirfigure"> t assas"she l2-CHP-6-FIG-1"/>Figure 6-1. The include optiam in a Sae l configurataam fite mh4>

The ny t=>".rr,lonfbal">includesttt> op aam doesdnot work wsth oue varia tes ny t=>".rr,lonfbal">%usttt> (user), ny t=>".rr,lonfbal">%Psttt> (current sheri's rooe diris ory), or ny t=>".rr,lonfbal">%Ssttt> (current sheri's assa) because tuey eri not ret at oueotisa the ny t=>".rr,lonfbal">includesttt> pdrsmeter is processed. man htdiv> hdivcond dirsecb3"> t assas"she l2-CHP-6-SECT-3.1.3"/> nh3cond dirhead3">copysth3n p>The ny t=>".rr,lonfbal">copysttt>st assas"INDEX-52"/> configurataam opbiam allows you oo clone tue configurataam opbiams of oueosheri assa that you spocicy inNthe current sheri. The target sheri mu=" appear earlisr in the configurataam fite than oueosheri ouatpis per>ormien oueocopy. For example: man blockquota> pray=>".rr,code">[bemplabe] wripable =dyes browsable =dyes valid users = andy, dave, jay [data] path = /usr/local/she l copy =dbemplabestara> /blockquota>

Notaythat any opbiams in oueosheri ouatpinvoked oue ny t=>".rr,lonfbal">copysttt> diris ive wsloioverride/thoseiin oueocloned sheri; itidoes not matbeu wuet e: hey appear bd>ori or afterithe ny t=>".rr,lonfbal">copysttt> diris ive. t assas"INDEX-53"/nnman htdiv> htdiv> htdiv> ndivcond dirsecb1"> t assas"she l2-CHP-6-SECT-4"/> nh2cond dirhead1">S Seou Configurataamsth2n p>nt assas"INDEX-54"/>We wsloinowistart from scratch and build a configurataam fite for ouraSae l s Seou. Firstawe wiloiiberoduce three b".ic configurataam opbiams that can appear in oueony t=>".rr,lonfbal">[global]sttt> s cbiam of tue nsmy=>".rr,f.leassa">smb.confstemn fite: man blockquota> pray=>".rr,code">[global] # S Seou configurataam pdrsmeters netbios assa =dboltec s Seou string =aSae l %v on %L workgroup = METRAN encryp apd dwords = yesstara> /blockquota>

Thisoconfigurataam fitepi aratty simple; itiadeoutises the Sae l s Seou under oueoNetBIOS assa ny t=>".rr,lonfbal">toltecsttt>.aIn addibion, ie places tueosysteL in oueoMETRAN workgroup andNdisplays a descripbiam oo clisbes tuatpincludes oueoSae l vousiam numbar, as wsloils the NetBIOS assa of the Sae l s Seou. man t assas"she l2-CHP-6-NOTE-130"/nnblockquotay=>".rr,nota">TIP mh4>

If you usad oueoline ny t=>".rr,lonfbal">encryp apd dwords = yessttt> im youraearlisr configurataam fite, you should do so uedd as wslo. man /blockquota> p>If you like,iyou can go ahead and try tuis configurataam fite. Crrate a fitepassad smy=>".rr,f.leassa">smb.confstemn under oue nsmy=>".rr,f.leassa">/usr/local/she l/libstemn diris ory wsth oue text lis"ed earlisr. Then ristart the Sae l s Seou and use a Wsndows clisbe to eouofy oue resacrs. Be sure that your WsndowsNclisbes are in oueoMETRAN workgroup as wslo. Afteridouble-clickien oueoNetwork Neighborhood on a WsndowsNclisbe, you should s e a windowisimilar to nt hdd>s"ch06.html#she l2-CHP-6-FIG-2">Figure 6-2. (In uis figure, ny t=>".rr,lonfbal">Mixtecsttt> is anot e: Sae l s Seou, ny t=>".rr,lonfbal">asttt>nd y t=>".rr,lonfbal">Zapotecsttt> is a Wsndows clisbe.) man divcond dirfigure"> t assas"she l2-CHP-6-FIG-2"/>Figure 6-2.oNetwork Neighborhood showien Toltec, the Sae l s Seou mh4>

You can eouofy oue y t=>".rr,lonfbal">s Seou mtt> ny t=>".rr,lonfbal">stringsttt> by lis"ienathe details of oueoNetwork Neighborhood windowi(salect Details in oueoView menu). You should s e a windowisimilar to nt hdd>s"ch06.html#she l2-CHP-6-FIG-3">Figure 6-3. man divcond dirfigure"> t assas"she l2-CHP-6-FIG-3"/>Figure 6-3.oNetwork Neighborhood details lis"ien mh4>

If you weri to click tue nsmy=>".rr,f.leassa">toltecstemn icam, a window should appear tuatoshowsNoueos Seices that it provides.aIn uis case, oueowindowiwould be completaly empty because tuere eri no sheris on oue s Seou yet.nman hdivcond dirsecb2"> t assas"she l2-CHP-6-SECT-4.1"/> nh3cond dirhead2">S Seou Configurataam Opbiamssth3n p>nt hdd>s"ch06.html#she l2-CHP-6-TABLE-4">Ta te 6-4 summarizes the s Seou configurataam opbiams ineroduced previously. All turee of tue.e opbiams are global in scope, so hey mu=" appear in oueony t=>".rr,lonfbal">[global]sttt> s cbiam of tue configurataam fite.nt assas"INDEX-55"/nnman t assas"she l2-CHP-6-TABLE-4"/>Ta te 6-4. S Seou configurataam opbiamssth4>

ntr> nyh>

Optoamstan /yh>

Pdrsmetersstan /yh>

Funcbiamstan /yh>

Defaacrstan /yh>

Scopestan /yh> ntr> nyd>

ny t=>".rr,lonfbal">netbiossttt> ny t=>".rr,lonfbal">nssasttt>stan /yd> nyd>

stringstan /yd> nyd>

NetBIOS assa of the Sae l s Seounman /yd> nyd>

S Seou's unqu,licoedpDNS hostassastan /yd> nyd>

Globalstan /yd> n/tr> nyr> nyd>

ny t=>".rr,lonfbal">workgroupsttt>stan /yd> nyd>

stringstan /yd> nyd>

NetBIOS group to whtt> tue s Seou belongsstan /yd> nyd>

Definedpat compite tisastan /yd> nyd>

Globalstan /yd> n/tr> nyr> nyd>

ny t=>".rr,lonfbal">s Seou mtt> ny t=>".rr,lonfbal">stringsttt>stan /yd> nyd>

stringstan /yd> nyd>

Descripbive string for oueoSae l s Seounman /yd> nyd>

ny t=>".rr,lonfbal">Sae l %vsttt>stan /yd> nyd>

Globalstan /yd> n/tr> n/tablen hdivcond dirsecb3"> t assas"she l2-CHP-6-SECT-4.1.1"/> nh3cond dirhead3">netbios assasth3n p>The ny t=>".rr,lonfbal">netbiossttt>nt assas"INDEX-56"/n y t=>".rr,lonfbal">nssasttt> opbiam allows you oo s t the NetBIOS assa of the s Seou. Foriexample: man blockquota> pray=>".rr,code">netbios assa =dYORKVM1stara> /blockquota>

The defaacravaluepforiouisoconfigurataam opbiam is tue s Seou's hostassa—ouatpis, the firstapart of ies fully qu,licoedpdomain assa. Foriexample, aosysteL wsth oue DNS assa ny t=>".rr,lonfbal">ruby.ora.comsttt> would be given the NetBIOS assa ny t=>".rr,lonfbal">RUBYsttt> by defaacr. Wuite you can use this opbiam to ristate tueosysteL's NetBIOS assa in the configurataam fite (as wspdid previously), it is mori commonly usad to lsrign the Sae l s Seou a NetBIOS assa ot e: han its current DNS assa. Remembar ouatpthe assa given mu=" follow oue rules for valid NetBIOS mat>one assas as outlinedpin nt hdd>s"ch01.html">Chapter 1. man p>Changien oueoNetBIOS assa of the s Seou isdnot ricommsbded unless you uave a good rrasam.aOneosut> rrasam might bi if oueohostassa of oue systeL is not unique because tueaLAN is divided overiowo or mori DNS domains. Foriexample, YORKVM1 is a good NetBIOS candidate for ny t=>".rr,lonfbal">vm1.york.example.comsttt> to dif>arentiaee it from ny t=>".rr,lonfbal">vm1.falkirk.example.comsttt>, whtt> hasNthe sssa hostassa but risides in a dif>arent DNS domain. man p>Anot e: use ofithis opbiam is for reloca ang SMB s Seices from a dead or retired systeL. Foriexample, if ny t=>".rr,lonfbal">SALESsttt> is tue SMB s Seer for oueodepartmsbe and it suddeney dies, you could immsdistaly ris t ny t=>".rr,lonfbal">netbiossttt> ny t=>".rr,lonfbal">nssasttt> ny t=>".rr,lonfbal">=sttt> ny t=>".rr,lonfbal">SALESsttt> on a backup Sae l s Seou ouat's takien oeer for ir. Usars won't have oo change ousir drive mappingsito a dif>arent s Seou;onew conn ctaams to ny t=>".rr,lonfbal">SALESsttt> wslo simply go to oue new s Seou. man htdiv> hdivcond dirsecb3"> t assas"she l2-CHP-6-SECT-4.1.2"/> nh3cond dirhead3">workgroupsth3n p>The ny t=>".rr,lonfbal">workgroupsttt>st assas"INDEX-57"/n parsmeter s tsNthe current workgroup (or domain) inNwhtt> tue Sae l s Seou wslo adeoutise itself. Clisbes tuatpwishpto atcess sheris on the Sae l s Seou should beiin oueosssa NetBIOS group. Remembar ouatpworkgroups are rially ju=" NetBIOS group assas and mu=" follow oue standard NetBIOS assienpconvenbiams outlinedpin nt hdd>s"ch01.html">Chapter 1. man p>The defaacraopbiam foriouisoparsmeter isdset at compite tisa to ny t=>".rr,lonfbal">WORKGROUPsttt>.aBecause tuis is the defaacraworkgroup assa of eeouy unconfigured WsndowsNand Sae l systeL, we ricommsbd that you alwaysoset your workgroup assa in the Sae l configurataam fite. When choosing youraworkgroup assa, try to avoid makien it the sssa assa as a seSeou or user.aTuis wsloiavoid possi te pro teLs wsth WINS assa risolutoam. man htdiv> hdivcond dirsecb3"> t assas"she l2-CHP-6-SECT-4.1.3"/> nh3cond dirhead3">s Seou stringsth3n p>The ny t=>".rr,lonfbal">s Seou mtt>st assas"INDEX-58"/n y t=>".rr,lonfbal">stringsttt> parsmeter defines a comment string that wsloiappear next to oue s Seou assa in both oueoNetwork Neighborhood (wuen shown wsth oue Details view) andNous comment entry of the Microsoft WsndowsNprinped managou. t assas"FNPTR-2"/nnt hdd>s"#FOOTNOTE-2">[2] man p>You can use varia tes to provide in>ormatiam in the descripbiam. Foriexample, ouraentry earlisr was: man blockquota> pray=>".rr,code">[global] s Seou string =aSae l %v on (%h)stara> /blockquota>

The defaacraforiouisoopbiam simply pre.ebes the current vousiam of Sae l end isdiquivalsbe to:nman t assas"INDEX-59"/nnblockquota> pray=>".rr,code">s Seou string =aSae l %vstara> /blockquota> htdiv> htdiv> ndivcond dirsecb1"> t assas"she l2-CHP-6-SECT-5"/> nh2cond dirhead1">Disk Sheri Configurataamsth2n p>nt assas"INDEX-60"/nnt assas"INDEX-61"/>We menbiamed in oue previous s cbiam ohar tuere weri no disk sheris on the ny t=>".rr,lonfbal">toltecsttt> s Seou. Let's continueabuildien oueoconfigurataam fite and crrateaan empty disk sheri calladony t=>".rr,lonfbal">[data]sttt>.aHere eri oue addibions that wsloido it: man blockquota> pray=>".rr,code">[data] path = /expore/she l/data comment = Data Drive volusa =dSample-Data-Drive wripable =dyesstara> /blockquota>

The ny t=>".rr,lonfbal">[data]sttt> sheri isptypocal for aaSae l disk sheri. The sheri maps to the diris ory nsmy=>".rr,f.leassa">/expore/she l/data stemnon the Sae l s Seou. We've also provided a comment that describes oue sheri as a ny t=>".rr,lonfbal">Datasttt> ny t=>".rr,lonfbal">Drivesttt>, as wsloils a volusa assa for oueosheri itself. man p>Sae l's defaacrais oo crrate a riad-only sheri. As a resacr, the ny t=>".rr,lonfbal">wripablesttt> op aam neads to be explicitly smt for eat> disk sheri you wishpto make wripable. man p>We wsloialso nead oo crrate oue nsmy=>".rr,f.leassa">/expore/she l/datastemn diris ory on the Sae l s Seou wsth oue followienacommands: man blockquota> pray=>".rr,code"># ny t=>".rr,usarinput"> b>mkdir /expore/she l/datastb>sttt> # ny t=>".rr,usarinput"> b>chmod 777 /expore/she l/datastb>sttt>stara> /blockquota>

Now, if we connecb to oue ny t=>".rr,lonfbal">toltecsttt> s Seou again by double-clickien its icam in oue WsndowsNNetwork Neighborhood, we wslo s e a sienle sheri entitlodony t=>".rr,lonfbal">datasttt>, as shown in nt hdd>s"ch06.html#she l2-CHP-6-FIG-4">Figure 6-4. Tuis sheri hasNriad/wripe atcess, so fites can be copied oo or from it. man divcond dirfigure"> t assas"she l2-CHP-6-FIG-4"/>Figure 6-4. The initaal data sheri on the Sae l s Seou mh4> hdivcond dirsecb2"> t assas"she l2-CHP-6-SECT-5.1"/> nh3cond dirhead2">Disk Sheri Configurataam Opbiamssth3n p>The b".ic Sae l configurataam opbiams for disk sheris previously ineroduced eri lis"ed in nt hdd>s"ch06.html#she l2-CHP-6-TABLE-5">Ta te 6-5. man t assas"she l2-CHP-6-TABLE-5"/>Ta te 6-5.aB".ic sheri configurataam opbiamssth4>

ntr> nyh>

Optoamstan /yh>

Pdrsmetersstan /yh>

Funcbiamstan /yh>

Defaacrstan /yh>

Scopestan /yh> ntr> nyd>

ny t=>".rr,lonfbal">pathsttt> ny t=>".rr,lonfbal">(diris ory)sttt>stan /yd> nyd>

string (diris ory assa)nman /yd> nyd>

S tsious Unixadiris ory that wsloibe provided for aadisk sheri or usad for spoolien by a prinped sheri.nman /yd> nyd>

ny t=>".rr,lonfbal">/tmpsttt>stan /yd> nyd>

Sheristan /yd> n/tr> nyr> nyd>

ny t=>".rr,lonfbal">commentsttt>stan /yd> nyd>

stringstan /yd> nyd>

S tsious comment that appears wsth the sheri.stan /yd> nyd>

Nonenman /yd> nyd>

Sheristan /yd> n/tr> nyr> nyd>

ny t=>".rr,lonfbal">volusasttt>stan /yd> nyd>

stringstan /yd> nyd>

S tsious MS-DOS volusa assa for oueosheri.nman /yd> nyd>

Sheri assastan /yd> nyd>

Sheristan /yd> n/tr> nyr> nyd>

ny t=>".rr,lonfbal">read onlysttt>stan /yd> nyd>

booleanstan /yd> nyd>

Ifpny t=>".rr,lonfbal">yessttt>, allows riad-only atcess to a sheri.nman /yd> nyd>

ny t=>".rr,lonfbal">yessttt>stan /yd> nyd>

Sheristan /yd> n/tr> nyr> nyd>

ny t=>".rr,lonfbal">wripablesttt> ny t=>".rr,lonfbal">(wripe ok o: wripeable)sttt>stan /yd> nyd>

booleanstan /yd> nyd>

Ifpny t=>".rr,lonfbal">nosttt>, allows riad-only atcess to a sheri. If ny t=>".rr,lonfbal">yessttt>, both readang and wripang ari allowed.nman /yd> nyd>

ny t=>".rr,lonfbal">nosttt>nman /yd> nyd>

Sheristan /yd> n/tr> n/tablen hdivcond dirsecb3"> t assas"she l2-CHP-6-SECT-5.1.1"/> nh3cond dirhead3">pathsth3n p>This t assas"INDEX-63"/>op aam, whtt> hasNthe synonym ny t=>".rr,lonfbal">diris orysttt>, sndicates tui pdthassa for oueorooe of the sherid diris ory or prinped. You can choose/any diris ory on the Sae l s Seou, so longils the owner of the Sae l process ouatpis connecbing hasNriad and wripe atcess to that diris ory.aIf the pdth is for a prinpang sheri, it should poibe to a bemporary diris ory wuedd fites can be wriptem on tue s Seou be>ori beang spooled oo the target prinped ( nsmy=>".rr,f.leassa"> /tmpstemn and nsmy=>".rr,f.leassa">/var/spoolstemn are popular choices).aIf this path is for aadisk sheri, oueocontsbes of oue folded repre.ebeien oueosheri assa on the clisbe wsloimatch oueocontsbes of oue diris ory on the Sae l s Seou. man p>The diris ory spocicoedpls the valuepforiny t=>".rr,lonfbal">pathsttt> can be given as a rilabive path, inNwhtt> case it wsloibe rilabive oo the diris ory spocicoedpby oueony t=>".rr,lonfbal">rooesttt> ny t=>".rr,lonfbal">diris orysttt>oparsmeter.aBecause ny t=>".rr,lonfbal">rooesttt> ny t=>".rr,lonfbal">diris orysttt>odefaacrs to rooe (nsmy=>".rr,f.leassa">/stemn ), it is generally a good ideloto use absoluta pdths for oueony t=>".rr,lonfbal">pathsttt> parsmeter, unless ny t=>".rr,lonfbal">rooesttt> ny t=>".rr,lonfbal">diris orysttt>ohasNbeen s t to sometuingiot e: han the defaacr. man htdiv> hdivcond dirsecb3"> t assas"she l2-CHP-6-SECT-5.1.2"/> nh3cond dirhead3">commentsth3n p>The ny t=>".rr,lonfbal">commentsttt>st assas"INDEX-64"/n opbiam allows you oo enped a comment that wsloibe ssbe to the clisbe wuen it atbempts to browse the sheri. The user can s e ous comment by usien oueoDetails view on oue sheri folded o: wsth the nsmy=>".rr,atShah b">n t viewstemn command at an MS-DOS prompt. Foriexample, hedd is how you might insert a comment for aasheri: man blockquota> pray=>".rr,code">[network] comment = Network Drive path = /expore/she l/networkstara> /blockquota>

Be sure nob to confuse tueany t=>".rr,lonfbal">commentsttt> op aam, whtt> documsbes a Sae l s Seou's sheris, wsth the ny t=>".rr,lonfbal">s Seou mtt> ny t=>".rr,lonfbal">stringsttt> op aam, whtt> documsbes the s Seou itself. man htdiv> hdivcond dirsecb3"> t assas"she l2-CHP-6-SECT-5.1.3"/> nh3cond dirhead3">volusasth3n p>This t assas"INDEX-65"/>op aam allows you oo spocicy the volusa assa of the sheri, whtt> would ot e:wise defaacrato oue nssa of oue sheri given in oueonsmy=>".rr,f.leassa">smb.confstemn fite. man p>Sosa softweri installataam progrsms check the volusa nssa of oue dis"ributoam CD-ROMpto make sure ths corris CD-ROMpis in oueodrive be>ori atbemptienpto install from it. If you copy oueocontsbes of oue CD-ROMpinto a network sheri and wishpto install from tuere, you can use this opbiam to make sure ths installataam progrsm s esNthe corris volusa nssa: man blockquota> pray=>".rr,code">[network] comment = Network Drive volusa =dASVP-102-RTYUIKA path = /hosa/she l/networkstara> /blockquota> htdiv> hdivcond dirsecb3"> t assas"she l2-CHP-6-SECT-5.1.4"/> nh3cond dirhead3">read only, wripablesth3n p>The opbiams ny t=>".rr,lonfbal">riadsttt> t assas"INDEX-66"/n y t=>".rr,lonfbal">onlysttt> and y t=>".rr,lonfbal">wripablesttt> t assas"INDEX-67"/n (also callad y t=>".rr,lonfbal">wripeablesttt> t assas"INDEX-68"/n or ny t=>".rr,lonfbal">wripesttt> t assas"INDEX-69"/n y t=>".rr,lonfbal">oksttt> ) are rially two waysoof sayien oueosssa thing, but they eri appdoat>ad from opposonf ends. Foriexample, you can s t eithe: of oue followienaopbiams in oue ny t=>".rr,lonfbal">[global]sttt> s cbiam or in an individualasheri: man blockquota> pray=>".rr,code">read only =dyes wripable =dnostara> /blockquota>

If eithe: opbiam is set as shown, data can be read from a sheri, but cannob be wriptem to it. You might think you would nead ohis opbiam only if you weri crratang a riad-only sheri. However, notaythat ohis riad-only behavior is the nsmy=>".rr,atShah b">defaacrstemn acbiam for sheris; if you wan" oo be abte to wripe data to a sheri, you mu=" explicitly spocicy one of tue followienaopbiams in oue configurataam fite for eat> sheri: man blockquota> pray=>".rr,code">read only =dno wripable =dyesstara> /blockquota>

If you spocicy mori than one occurrenca of eithe: opbiam, Sae l wslo adheri to oueolasravaluepit encoubeers for oueosheri. t assas"INDEX-70"/nnt assas"INDEX-71"/nnman htdiv> htdiv> htdiv> ndivcond dirsecb1"> t assas"she l2-CHP-6-SECT-6"/> nh2cond dirhead1">NetworkienaOp iamsawith Sae lsth2n p>nt assas"INDEX-72"/nnt assas"INDEX-73"/>If you're runnien nt assas"INDEX-74"/nnt assas"INDEX-75"/>Sae loon a macrihosad systeL (am macriple subnets), you wiloinead oo configure Sae loto use lll tue network inpedfaces. Anot e: use for oueoopbiams pre.ebeed in ouisps ctaam is to implement better s curity by allowienaor disallowienaconn ctaams on tue spocicoedpinpedfaces. man p>Let's assumspthat ouraSae l s Seou can atcess both oue subnets 192.168.220.* and 134.213.233.*.aHere eri ouraaddibions to the configurataam fite to add tue networkienaconfigurataam opbiams: man blockquota> pray=>".rr,code">[global] # Networkienaconfigurataam opbiams hosts allow = 192.168.220. 134.213.233. hosts deny = 192.168.220.102 inpedfaces = 192.168.220.100/255.255.255.0 \ 134.213.233.110/255.255.255.0 bindpinpedfaces only =dyesstara> /blockquota>

Take a look at tueiny t=>".rr,lonfbal">hostssttt> t assas"INDEX-76"/n y t=>".rr,lonfbal">allowsttt> and y t=>".rr,lonfbal">hostssttt> t assas"INDEX-77"/n y t=>".rr,lonfbal">denysttt> op aams.aIf these opbiams sound famililr, you're pro ably thinking of oueonsmy=>".rr,f.leassa">hosts.allowstemn and nsmy=>".rr,f.leassa">hosts.denystemn fites ouatpare found in ui nsmy=>".rr,f.leassa">/etcstemn diris ories of many UnixasysteLs. The purpose of tue.e opbiams is idebeical to tho.e fites; they provide a meams of security by allowienaor denyien oueoconn ctaams of ot e: hosts b".ed on ousir IP addresses. We could use the nsmy=>".rr,f.leassa">hosts.allowstemn and nsmy=>".rr,f.leassa">hosts.denystemn fites, but we eri usien tuis metuod ins"ead because tuere might bi s Seices on tue s Seou that we wan" ot e:spto atcess withoutialso givien them atcess to Sae l's disk or prinped sheris.stan p>Wsth oue ny t=>".rr,lonfbal">hostssttt> y t=>".rr,lonfbal">allowsttt> opbiam, we've spocicoedpl 192.168.220 IP address, whtt> is iquivalsbe to sayien: "Aloihosts on tue 192.168.220 subnet." However, we've explicitly spocicoedpin a ny t=>".rr,lonfbal">hostssttt> y t=>".rr,lonfbal">denysttt> line that 192.168.220.102 is not oo be allowed atcess. man p>You might bi wonderien why 192.168.220.102 wsloibsodenoedpeven/ uough ie is stiloiib oue subnetimatchedpby oueony t=>".rr,lonfbal">hostssttt> y t=>".rr,lonfbal">allowsttt> opbiam.aIe is importan" oo understand how Sae l sorts out oue rules spocicoedpby ny t=>".rr,lonfbal">hostssttt> y t=>".rr,lonfbal">allowsttt> and y t=>".rr,lonfbal">hostssttt> y t=>".rr,lonfbal">denysttt> : man ol>

  • Ifpno y t=>".rr,lonfbal">allowsttt> or y t=>".rr,lonfbal">denysttt> op aams eri definedpanywuedd in nsmy=>".rr,f.leassa">smb.confstemn, Sae l wsloiallow conn ctaams from any systeL.stan /li>

  • Ifpny t=>".rr,lonfbal">hostssttt> y t=>".rr,lonfbal">allowsttt> or ny t=>".rr,lonfbal">hostssttt> y t=>".rr,lonfbal">denysttt> opbiams are defined in oueony t=>".rr,lonfbal">[global]sttt> s cbiam of nsmy=>".rr,f.leassa">smb.confstemn, they wsloiapply to all sheris, even/if eithe: opbiam is definedpin one or mori of the sheris.stan /li>

  • Ifponly a ny t=>".rr,lonfbal">hostssttt> y t=>".rr,lonfbal">allowsttt> opbiam is definedpfor aasheri,ponly oueohosts lis"ed wsloibsoallowed to use oue sheri. All ot e:spwsloibsodenoed.stan /li>

  • Ifponly a ny t=>".rr,lonfbal">hostssttt> y t=>".rr,lonfbal">denysttt> opbiam is definedpfor aasheri,pany clisbe wutt> is not on oueolist wsloibe able to use oue sheri.nman /li>

  • Ifpboth a ny t=>".rr,lonfbal">hostssttt> y t=>".rr,lonfbal">allowsttt> and ny t=>".rr,lonfbal">hostssttt> y t=>".rr,lonfbal">denysttt> opbiam are defined, aohost mu=" appear in oueoallow list and nob appear in oueodeny list (in anypform)pto atcess oueosheri. Ot e:wise, oueohost wsloinot bi allowed.nman /li>".rr,nota">WARNING mh4>

    Take care that you don't explicitly allow aohost to ltcess a sheri, butithen deny atcess to the entire subnetiof whtt> oueohost isopart. man /blockquota> p>Let's look at anot e: example of that fin,lpiteL. Camsider oueofollowienaopbiams: man blockquota> pray=>".rr,code">hosts allow = 111.222. hosts deny = 111.222.333.stara> /blockquota>

    In uis case,ponly oueohosts that belong to the subneti111.222.*.* wsloibsoallowed atcess to the Sae l sheris. However, if a clisbe belongs to the 111.222.333.* subnet, it wsloibe denoedpatcess, even uough it stsloimatches tui qu,licocabiams outlinedpby ny t=>".rr,lonfbal">hostssttt> y t=>".rr,lonfbal">allowsttt>. The clisbe mu=" appear on the ny t=>".rr,lonfbal">hostssttt> y t=>".rr,lonfbal">allowsttt> list and nsmy=>".rr,atShah b">mu=" norstemn appear on the ny t=>".rr,lonfbal">hostssttt> y t=>".rr,lonfbal">denysttt> list to gain atcess to l Sae l sheri. man p>The ot e: wo opbiams that we've spocicoedplre ny t=>".rr,lonfbal">inpedfacessttt> and y t=>".rr,lonfbal">bindsttt> y t=>".rr,lonfbal">inpedfacesttt> y t=>".rr,lonfbal">onlysttt>. Let's look at tueiny t=>".rr,lonfbal">inpedfacessttt> opbiam first.aSae l, by defaacr, ssbds data only from the primary network inpedface, whtt> in ouraexample is the 192.168.220.100 subnet.aIf we would like it to ssbd data to mori than that one inpedface, weinead oo spocicy the completaolist wsth the ny t=>".rr,lonfbal">inpedfacessttt> opbiam.aIn oue previous example, we've bound Sae loto inpedface wsth both subnets (192.168.220 and 134.213.233) on whtt> tue systeL is operatang by spocicyien oueoot e: network inpedface address: 134.213.233.100. If you have mori than one inpedface on youracomputer, you should always s t this opbiam,pls there isdno guaran"ee ouatpthe primary inpedface that Sae l choosespwsloibsooue right one. man p>Fin,lly, tueiny t=>".rr,lonfbal">bindsttt>iny t=>".rr,lonfbal">inpedfacessttt> y t=>".rr,lonfbal">onlysttt> optiam in="rus s the nsmy=>".rr,f.leassa">nmbdstemn process nob to accep anypbroadcast messages ot e: han ob oue subnets spocicoedpwsth the ny t=>".rr,lonfbal">inpedfacessttt> opbiam.aTuis is dif>arent from the ny t=>".rr,lonfbal">hostssttt> y t=>".rr,lonfbal">allowsttt> and ny t=>".rr,lonfbal">hostssttt> y t=>".rr,lonfbal">denysttt> opbiams, whtt> prevent clisbes from makien conn ctaams to s Seices, but not from receivien broadcast messages. Usien oueony t=>".rr,lonfbal">bindsttt> y t=>".rr,lonfbal">inpedfacessttt> y t=>".rr,lonfbal">onlysttt> opbiam is l way to shut outiall datagrsms from >oriign subnets.aIn addibion, it in="rus s the nsmy=>".rr,atShah b">smbdstemn process oo bind toponly oue inpedfaceolist given by oueonsmy=>".rr,atShah b">inpedfacesstemnaopbiam. This ristris s the networks that Sae l wslois Seo.nman hdivcond dirsecb2"> t assas"she l2-CHP-6-SECT-6.1"/> nh3cond dirhead2">NetworkienaOp iamssth3n p>The networkienaopbiams we ineroduced earlisr eri summarized in nt hdd>s"ch06.html#she l2-CHP-6-TABLE-6">Ta te 6-6. man t assas"she l2-CHP-6-TABLE-6"/>Ta te 6-6. Networkienaconfigurataam opbiamssth4>

  • ntr> nyh>

    Optoamstan /yh>

    Pdrsmetersstan /yh>

    Funcbiamstan /yh>

    Defaacrstan /yh>

    Scopestan /yh> ntr> nyd>

    ny t=>".rr,lonfbal">hosts allow (allowsttt> ny t=>".rr,lonfbal">hosts)sttt>stan /yd> nyd>

    string (list of hostassas)nman /yd> nyd>

    Clisbe systeLs that can connecb to Sae l.stan /yd> nyd>

    Nonenman /yd> nyd>

    Sheristan /yd> n/tr> nyr> nyd>

    ny t=>".rr,lonfbal">hosts deny (denysttt> ny t=>".rr,lonfbal">hosts)sttt>stan /yd> nyd>

    string (list of hostassas)nman /yd> nyd>

    Clisbe systeLs that cannot connecb to Sae l.stan /yd> nyd>

    Nonenman /yd> nyd>

    Sheristan /yd> n/tr> nyr> nyd>

    ny t=>".rr,lonfbal">inpedfacessttt>stan /yd> nyd>

    string (list of IP/netmask combinabiams)stan /yd> nyd>

    Network inpedfaces Sae l wsloirispond to. AllowsNcorris ing defaacrs.nman /yd> nyd>

    SysteL-depsbdentstan /yd> nyd>

    Globalstan /yd> n/tr> nyr> nyd>

    ny t=>".rr,lonfbal">bindsttt> man p>ny t=>".rr,lonfbal">inpedfaces onlysttt>stan /yd> nyd>

    booleanstan /yd> nyd>

    Ifps t topny t=>".rr,lonfbal">yessttt>, Sae l wsloibind only oo tho.e inpedfaces spocicoedpby oueony t=>".rr,lonfbal">inpedfacessttt> opbiam.nman /yd> nyd>

    ny t=>".rr,lonfbal">nosttt>nman /yd> nyd>

    Globalstan /yd> n/tr> n/tablen hdivcond dirsecb3"> t assas"she l2-CHP-6-SECT-6.1.1"/> nh3cond dirhead3">hosts allowsth3n p>The ny t=>".rr,lonfbal">hostssttt> y t=>".rr,lonfbal">allowsttt> opbiam (sometisas wriptem as y t=>".rr,lonfbal">allowsttt> ny t=>".rr,lonfbal">hostssttt>) spocicoes the clisbes that have permissiam to atcess sheris on the Sae l s Seou, wriptem as a comma- or space-separa"ed list of hostassas of systeLs or oueir IP addresses. You can gain quipe aibit of security by simply placing your LAN's subnetiaddress in ouis opbiam. man p>You can spocicy any of oueofollowiena>ormatsaforiouisoopbiam: man ul>

  • Hostassas,osut> as ny t=>".rr,lonfbal">ftp.example.comsttt> .nman /li>

  • IP addresses,osut> as ny t=>".rr,lonfbal">130.63.9.252sttt>. man /li>

  • Domain assas, whtt> can be dif>arentiaeed from individualahostassas because tueyistart with a dot. Foriexample, ny t=>".rr,lonfbal">.ora.comsttt> repre.ebes all systeLs within ui nsmy=>".rr,atShah b">ora.comstemn domain. man /li>

  • Netgroups, whtt> start with an at rign (ny t=>".rr,lonfbal">@sttt>),osut> as ny t=>".rr,lonfbal">@prinpedhostssttt>. Netgroups eri usually available only am systeLs runnien NIS or NIS+.aIf netgroups eri supported on yourasysteL, there should beia ny t=>".rr,lonfbal">netgroupssttt> manual page that describes oueL in mori detail. man /li>

  • Subnets, whtt> end with a dot. Foriexample, ny t=>".rr,lonfbal">130.63.9sttt>. meams lll tue systeLs who.e IP addresses begin wsth 130.63.9. man /li>

  • The keyword ny t=>".rr,lonfbal">ALLsttt>, whtt> allows any clisbe atcess. man /li>

  • The keyword ny t=>".rr,lonfbal">EXCEPTsttt> followedpby one or mori assas, IP addresses,odomain assas, netgroups, or subnets.aForiexample, you could spocicy that Sae l allow aloihosts excep tho.e on the 192.168.110 subnetiwsth ny t=>".rr,lonfbal">hostssttt> y t=>".rr,lonfbal">allowsttt> ny t=>".rr,lonfbal">=sttt> ny t=>".rr,lonfbal">ALLsttt> ny t=>".rr,lonfbal">EXCEPTsttt> ny t=>".rr,lonfbal">192.168.110sttt>. (remembar to include oue trailing dot).nman /li>

    Usien oueony t=>".rr,lonfbal">ALLsttt> keyword by itself is almost alwaysoa bad idelobecause it meams that cracke:spon anypnetwork can atcess youraSae l s Seou. man p>The hostassa ny t=>".rr,lonfbal">localhoststtt>, for oueoloopback address 127.0.0.1,pis included in oueony t=>".rr,lonfbal">hostssttt> y t=>".rr,lonfbal">allowsttt> list by defaacr andNdoes not nead oo be lis"ed explicitly unless you have spocicoedpthe ny t=>".rr,lonfbal">bindsttt>iny t=>".rr,lonfbal">inpedfacessttt> y t=>".rr,lonfbal">onlysttt> parsmeter.aTuis address is riquiredpfor Sae l to work properly. man p>Ot e: han that, there isdno defaacravaluepforioue ny t=>".rr,lonfbal">hostssttt> y t=>".rr,lonfbal">allowsttt> configurataam opbiam. The defaacracourse of acbiam in oueoevent that neithe: oue ny t=>".rr,lonfbal">hostssttt> y t=>".rr,lonfbal">allowsttt> or ny t=>".rr,lonfbal">hostssttt> y t=>".rr,lonfbal">denysttt> opbiam is spocicoed in nsmy=>".rr,f.leassa">smb.confstemn is to allow atcess from all sources. man t assas"she l2-CHP-6-NOTE-132"/nnblockquotay=>".rr,nota">TIP mh4>

    If you spocicy ny t=>".rr,lonfbal">hosts allowsttt> im oue ny t=>".rr,lonfbal">[global]sttt> s cbiam, that definitaon wsloioverride anypny t=>".rr,lonfbal">hosts allowsttt> lines in oueosheri definitaons. This is the opposonf of oueousual behavior, whtt> is foripdrsmeters s t in sheri definitaons topoverride/defaacravalues set im oue ny t=>".rr,lonfbal">[global]sttt> s cbiam.nt assas"INDEX-78"/nnman /blockquota> htdiv> hdivcond dirsecb3"> t assas"she l2-CHP-6-SECT-6.1.2"/> nh3cond dirhead3">hosts denysth3n p>The ny t=>".rr,lonfbal">hostssttt> y t=>".rr,lonfbal">denysttt> opbiam (synonymous wsth ny t=>".rr,lonfbal">denysttt> ny t=>".rr,lonfbal">hostssttt>) spocicoes clisbe systeLs that do not have permissiampto atcess a sheri, wriptem as a comma- or space-separa"ed list of hostassas or ousir IP addresses. Use oue sssa format for spocicyien clisbes as oue ny t=>".rr,lonfbal">hostssttt> y t=>".rr,lonfbal">allowsttt> opbiam earlisr. For example, to ristris atcess to the s Seer from eeouywuedd but ny t=>".rr,lonfbal">example.comsttt>, you could wripe: man blockquota> pray=>".rr,code">hosts deny = ALL EXCEPT .example.comstara> /blockquota>

    There isdno defaacravaluepforioueony t=>".rr,lonfbal">hostssttt> y t=>".rr,lonfbal">denysttt> configurataam opbiam, al uough the defaacr course of acbiam in oueoevent that neithe: opbiam is spocicoed is to allow atcess from all sources. Also, if you spocicy this opbiam in oueony t=>".rr,lonfbal">[global]sttt> s cbiam of tue configurataam fite, it wsloioverride/anypny t=>".rr,lonfbal">hostssttt> y t=>".rr,lonfbal">denysttt> opbiams definedpin sheris. If you wishpto deny atcess to spocicoc sheris, omit both oueony t=>".rr,lonfbal">hostssttt> y t=>".rr,lonfbal">allowsttt> and y t=>".rr,lonfbal">hostssttt> y t=>".rr,lonfbal">denysttt> opbiams from the ny t=>".rr,lonfbal">[global]sttt> s cbiam of tue configurataam fite.nman t assas"she l2-CHP-6-NOTE-133"/nnblockquotay=>".rr,nota">NOTE mh4>

    Neeou include oue loopback address (ny t=>".rr,lonfbal">localhoststtt> at IP address 127.0.0.1) in oueony t=>".rr,lonfbal">hosts denysttt> list. The nsmy=>".rr,f.leassa">smbpd dwdstemn progrsm neads to connecb through the loopback address to the Sae l s Seou as a clisbe oo change a useu's encryp ed pd dword.aIf the loopback address is disabled, the locally genera ed pdckets riques"ienathe change of oueoencryp ed pd dword wsloibe discardedpby Sae l.stan

    In addibion, both local browsienapropagataam and some funcbiams of SWAT riquire atcess to the Sae l s Seou through the loopback address and wiloinot work corris ly if tuis address is disabled. t assas"INDEX-79"/nnman /blockquota> htdiv> hdivcond dirsecb3"> t assas"she l2-CHP-6-SECT-6.1.3"/> nh3cond dirhead3">inpedfacessth3n p>The ny t=>".rr,lonfbal">inpedfacessttt>st assas"INDEX-80"/n opbiam spocicoes the networks that you wan" ohe Sae l s Seou to ricognizi and rispond to. This opbiam is handy if you uave a computer that risides on mori than one network subnet.aIf this opbiam is not ret, Sae l s arches forioue primary network inpedface of the s Seou (typocally oueofirstaEthe:net card) upam startup andNconfigures itself topoperate on only ouat subnet.aIf the s Seou isdconfigured for mori than one subnetiandNyou do not spocicy this opbiam, Sae l wsloionly work on the firstasubnet it encoubeers. You mu=" use this opbiam to force Sae loto s Seoioue ot e: subnets on youranetwork. man p>The valuepofithis opbiam is one or mori s tsNof IP address/netmask pairs,pls in oueofollowien: man blockquota> pray=>".rr,code">inpedfaces = 192.168.220.100/255.255.255.0 192.168.210.30/255.255.255.0stara> /blockquota>

    You can opbiamally spocicy a t assas"INDEX-81"/nnt assas"INDEX-82"/>CIDR format bitmask, like this: man blockquota> pray=>".rr,code">inpedfaces = 192.168.220.100/24 192.168.210.30/24stara> /blockquota>

    The numbar afterithe s>".h spocicoes the numbar of bits that wsloibe set im oue netmask.aForiexample, the numbar 24 meams that the first 24 (of 32) bits wsloibe sst im oue bitmask, whtt> is oue sssa as spocicyien 255.255.255.0 as oue netmask.aLikewise, 16 would be iquivalsbe to a netmask of 255.255.0.0,iandN8 would be oue sssa as a netmask of 255.0.0.0.nman t assas"she l2-CHP-6-NOTE-135"/nnblockquotay=>".rr,nota">WARNING mh4>

    This opbiam might not work corris ly if you ari usien DHCP.nman /blockquota> htdiv> hdivcond dirsecb3"> t assas"she l2-CHP-6-SECT-6.1.4"/> nh3cond dirhead3">bindpinpedfaces onlysth3n p>The ny t=>".rr,lonfbal">bindsttt> t assas"INDEX-83"/> y t=>".rr,lonfbal">inpedfacessttt> y t=>".rr,lonfbal">onlysttt> opbiam can be usad to force the nsmy=>".rr,atShah b">smbdstemn and nsmy=>".rr,atShah b">nmbdstemn processes to rispond only oo tho.e addresses spocicoedpby oueony t=>".rr,lonfbal">inpedfacessttt> opbiam. The nsmy=>".rr,atShah b">nmbdstemn process normally binds to the all-addresses inpedface (0.0.0.0.) on ports 137 and 138, allowienait to receive broadcasts from anywuedd. However, you can override/this behavior wsth oue followien: man blockquota> pray=>".rr,code">bindpinpedfaces only =dyesstara> /blockquota>

    Tuis wsloicause Sae loto ignori any pdckets (includien broadcast pdckets) who.e source address does not corrispond to any of oue network inpedfaces spocicoedpby oueony t=>".rr,lonfbal">inpedfacessttt> opbiam. You should avoid usien tuis opbiam if you wan" oo allow bemporary network conn ctaams,osut> as tho.e crrated through SLIP or PPP.aIe's eouy rare that this opbiam is neaded, and it should be used only by experts. man t assas"she l2-CHP-6-NOTE-136"/nnblockquotay=>".rr,nota">TIP mh4>

    If you s t ny t=>".rr,lonfbal">bindpinpedfaces onlysttt> to ny t=>".rr,lonfbal">yessttt> , add tue t assas"INDEX-84"/nnt assas"INDEX-85"/nnt assas"INDEX-86"/nlocal host address (127.0.01) oo the "inpedfaces" list. Ot e:wise, nsmy=>".rr,atShah b">smbpd dwdstemn wsloibe unabte to connecb to oue s Seou usien its defaacramode in ordou to change a pd dword, local browse list propagataam wsloifail, and some funcbiams of swat wslo not work properly. t assas"INDEX-87"/nnt assas"INDEX-88"/nnman /blockquota> htdiv> htdiv> htdiv> ndivcond dirsecb1"> t assas"she l2-CHP-6-SECT-7"/> nh2cond dirhead1">Virtual S Seoussth2n p>nt assas"INDEX-89"/nVirtual s Seous can be usad to crrate oue slousiam of uavien macriple s Seous on the network, wuen in riality there isdonly ami. The technique is simple to implement: aosysteL simply regis"ers mori than one NetBIOS assa in d dociataam wsth its IP address. There eri tangible benefits to doien tuis. man p>Foriexample, the accoubeing departmsbe might uave an y t=>".rr,lonfbal">accoubeingsttt> s Seou, and clisbes of it would see ju=" the accoubeing disksNand prinpeds. The marketing departmsbe could uave its own s Seou, y t=>".rr,lonfbal">marketingsttt>, wsth its own reports, and so am. However, lll tue s Seices would be provided by one msdium-sizi Unixas Seou (and one rilaxedpldminis"rator) ins"ead of uavien one smalois Seor per departmsbe.nman hdivcond dirsecb2"> t assas"she l2-CHP-6-SECT-7.1"/> nh3cond dirhead2">Virtual S Seou Configurataam Opbiamssth3n p>nt assas"INDEX-90"/nnt assas"INDEX-91"/>Sae lowsloiallow l s Seou to use mori than one NetBIOS nssa wsth oue ny t=>".rr,lonfbal">netbiossttt> y t=>".rr,lonfbal">aliasessttt> opbiam. See nt hdd>s"ch06.html#she l2-CHP-6-TABLE-7">Ta te 6-7. man t assas"she l2-CHP-6-TABLE-7"/>Ta te 6-7. Virtual s Seou configurataam opbiamssth4>

  • ntr> nyh>

    Optoamstan /yh>

    Pdrsmetersstan /yh>

    Funcbiamstan /yh>

    Defaacrstan /yh>

    Scopestan /yh> ntr> nyd>

    ny t=>".rr,lonfbal">netbiossttt> ny t=>".rr,lonfbal">aliasessttt>stan /yd> nyd>

    string (list of NetBIOS nssas)stan /yd> nyd>

    Addibional NetBIOS nssas to rispond to, for use wsth macriple "virtual" Sae l s Seousstan /yd> nyd>

    Nonenman /yd> nyd>

    Globalstan /yd> n/tr> n/tablen hdivcond dirsecb3"> t assas"she l2-CHP-6-SECT-7.1.1"/> nh3cond dirhead3">netbios aliasessth3n p>The ny t=>".rr,lonfbal">netbiossttt>nt assas"INDEX-92"/> y t=>".rr,lonfbal">aliasessttt> opbiam can be usad to gieoioue Sae l s Seou mori than one NetBIOS assa. Eat> NetBIOS nssa lis"ed as a valuepwsloibe displayed in oueoNetwork Neighborhood of Wsndows clisbes. When a conn ctaam is riques"ed to any of oue s Seous, it wsloiconnecb to oue sssa Sae l s Seou. man p>This might cosa in handy, for example, if you're "ransferrien tureeodepartmsbes' data to a sienle Unixas Seou wsth larger and faster disksNand are ritirienaor rialloca ang the old WsndowsNNT/2000 s Seous.aIf the tureeos Seous eri calladony t=>".rr,lonfbal">salessttt>, y t=>".rr,lonfbal">accoubeingsttt>, and y t=>".rr,lonfbal">ldminsttt>, you can uave Sae l repre.ebe lll turee s Seous wsth oue followienaopbiams: man blockquota> pray=>".rr,code">[global] netbios aliases =dsales accoubeing ldmin include = /usr/local/she l/lib/smb.conf.%Lstara> /blockquota>

    See nt hdd>s"ch06.html#she l2-CHP-6-FIG-5">Figure 6-5 for what the Network Neighborhood would display from a clisbe. When a clisbe atbempts to connecb to Sae l, it wsloispocicy the assa of the s Seou to whtt> it's tryienpto connecb, whtt> is made/available in oueoconfigurataam fite through the y t=>".rr,lonfbal">%Lsttt> varia te. If oue riques"ed s Seou isdny t=>".rr,lonfbal">salessttt>, Sae lowsloiinclude the fileonsmy=>".rr,f.leassa">/usr/local/she l/lib/smb.conf.salesstemn. This fileomight contain global and sheri de=>"rabiams excousivaly for ousdsales "eam,osut> as the followien: man blockquota> pray=>".rr,code">[global] workgroup = SALES hosts allow = 192.168.10.255 [sales2003] path = /usr/local/she l/sales/sales2003/ ...stara> /blockquota>

    Tuis particular example would set the workgroup to SALES as wsloilnd set the IP address to allow conn ctaams only from the SALES subnet (192.168.10).aIn addibion, it would of>ar sheris spocicoc to oue sales departmsbe.nman divcond dirfigure"> t assas"she l2-CHP-6-FIG-5"/>Figure 6-5. Usien NetBIOS aliases for aaSae l s Seou mh4> htdiv> htdiv> htdiv> ndivcond dirsecb1"> t assas"she l2-CHP-6-SECT-8"/> nh2cond dirhead1">Loggien Configurataam Opbiamssth2n p>nt assas"INDEX-93"/nnt assas"INDEX-94"/nOccasiamally, we nead oo find out what Sae l is up to.aTuis is espocially oruepwhen Sae l is performang an unexpec"ed acbiam or is not performang ae lll. To find out tuis in>ormatiam, weinead oo check Sae l's log fites oo s e exas ly why it did what it did. man p>Sae l t assas"INDEX-95"/nlog fites can be asNbrief or eoubose/as you like.aHere is an example of what a Sae l log fite looks like: man blockquota> pray=>".rr,code">[2002/07/21 13:23:25, 3] smbd/s Seice.c:close_cnum(514) maya (172.16.1.6) closed conn ctaam to s Seice IPC$ [2002/07/21 13:23:25, 3] smbd/conn ctaam.c:yield_conn ctaam(40) Yieldien conn ctaam to IPC$ [2002/07/21 13:23:25, 3] smbd/process.c:process_smb(615) Transacbiam 923 of leagth 49 [2002/07/21 13:23:25, 3] smbd/process.c:swstch_message(448) swstch message SMBread (pid 467) [2002/07/21 13:23:25, 3] lib/doscalls.c:dos_ChDir(336) dos_ChDir to /hosa/she l [2002/07/21 13:23:25, 3] smbd/reply.c:reply_read(2199) read fnum=4207 num=2820 nread=2820 [2002/07/21 13:23:25, 3] smbd/process.c:process_smb(615) Transacbiam 924 of leagth 55 [2002/07/21 13:23:25, 3] smbd/process.c:swstch_message(448) swstch message SMBreadbraw (pid 467) [2002/07/21 13:23:25, 3] smbd/reply.c:reply_readbraw(2053) readbraw fnum=4207 start=130820 max=1276omin=0 nread=1276 [2002/07/21 13:23:25, 3] smbd/process.c:process_smb(615) Transacbiam 925 of leagth 55 [2002/07/21 13:23:25, 3] smbd/process.c:swstch_message(448) swstch message SMBreadbraw (pid 467)stara> /blockquota>

    Mut> ofithis in>ormatiam is of u.e only oo Sae l progrsmmous. However, weowsloigopover the meaming of some of tue.e entries in mori detail in nt hdd>s"ch12.html">Chapter 12. man p>Sae l contains sixaopbiams that allow useuspto describe how and where loggien in>ormatiam should be wriptem. Eat> of tue.e eri global opbiams and cannot appear inside/a sheri definitaon.aHere is an example of some loggien opbiams that we eri addienpto our configurataam fite: man blockquota> pray=>".rr,code">[global] log level = 2 log fite = /var/log/she l.log.%m max log sizi = 50 debunptisastamp =dyesstara> /blockquota>

    Here, we've addedpl custom log fite that riports in>ormatiam up to debunplevel 2.aTuis is a rilabively light debungien level. The loggien level ranges from 1 to 10, where level 1 provides only a smaloiamoube of in>ormatiam and level 10 provides a pletuora of low-level in>ormatiam. Levels 2 or 3owsloiprovide us wsth useful debungien in>ormatiam withoutiwaseing disk space on ouras Seou. In pracbice, you should avoid usien log levels grrate: han 3 unless you eri workienaon the Sae l source code. man p>The loggien fite is located in oueonsmy=>".rr,f.leassa">/var/logstemn diris ory thanks to oue ny t=>".rr,lonfbal">logsttt> y t=>".rr,lonfbal">f.lesttt> configurataam opbiam. However, we can use varia te subseitutaam to crrate log fites spocicocally for individual useuspor clisbes,osut> as wsth oue ny t=>".rr,lonfbal">%msttt> varia te in oueofollowienaline: man blockquota> pray=>".rr,code">log fite = /usr/local/logs/she l.log.%mstara> /blockquota>

    Isola ang the log messages can be invalua te in trackien down a network error if you know the pro tem isdcomang from a spocicoc clisbe systeL or useu. man p>We've addedpl aracautaam to the log fites:dno one log fite can excead 50 KBpin sizi, as spocicoedpby oue y t=>".rr,lonfbal">maxsttt> ny t=>".rr,lonfbal">logsttt>dny t=>".rr,lonfbal">sizisttt> opbiam. If l log fite exceadsithis sizi, oueocontsbes eri moved to a fite wsth the sasa nssa but wsth the suffixansmy=>".rr,atShah b">.oldstemn appended.aIf the nsmy=>".rr,atShah b">.oldstemn fite already exists, it is overwriptem andpitsocontsbes eri lost. The origin,lpfite is cleerid, waitienpto receiveinew loggien in>ormatiam.aTuis prevents the herd drive from beang overwhelmedpwsth Sae l log fites durang the life of oueoSae l daemons. man p>We uave docided to wripe the tisastamps of oue messages in oueologs wsth oue ny t=>".rr,lonfbal">debunsttt>dny t=>".rr,lonfbal">tisastampsttt> opbiam, whtt> is oue defaacrabehavior.aTuis wsloiplace aptisastamp in eat> message wriptem to the loggien fite.aIf we were nob inpedes"ed in ouis in>ormatiam, weicould spocicy ny t=>".rr,lonfbal">nosttt>aforiouis optiam in="ead.nman hdivcond dirsecb2"> t assas"she l2-CHP-6-SECT-8.1"/> nh3cond dirhead2">Usien syslogsth3n p>If you wishpto use oue systeL logger ( t assas"INDEX-96"/nsyslogssmy=>".rr,f.leassa"> stemn) in addibionpto or in place of the standerd Sae l loggien fite, Sae l provides opbiams foriouisoas wslo. However, to use syslog, the firstatuingiyou wiloiuave to do is make sure that Sae l was built wsth oue ny t=>".rr,lonfbal">configuresttt> y t=>".rr,lonfbal">--wsth-syslogsttt> opbiam. See nt hdd>s"ch02.html">Chapter 2 for mori in>ormatiam on configurang and compiling Sae l. See nt hdd>s"appe.html">AppendixaE for mori in>ormatiam about oue y t=>".rr,lonfbal">--wsth-syslogsttt> opbiam. man p>Once ouatpis done, you wiloinead oo configure your nsmy=>".rr,f.leassa">/etc/syslog.confstemn t assas"INDEX-97"/n to accep loggien in>ormatiam from Sae l. If there isdnot already a ny t=>".rr,lonfbal">daemon.*sttt> entry in ui nsmy=>".rr,f.leassa">/etc/syslog.confstemn fite, add tue followien: man blockquota> pray=>".rr,code">daemon.* /var/log/daemon.logstara> /blockquota>

    Tuis spocicoes tha anyploggien in>ormatiam from systeL daemons wslo be s ored in oueonsmy=>".rr,f.leassa">/var/log/daemon.logstemn fite.aTuis is where oueoSae l in>ormatiam wiloibe s ored as wslo. From tuere, you can s t aavaluepforioueony t=>".rr,lonfbal">syslogsttt> pdrsmeter in youraSae l configurataam fite to spocicy whtt> loggien messages lre oo be ssbe to syslog. Only messages that have debunplevels lowe: han the valuepofitheony t=>".rr,lonfbal">syslogsttt> pdrsmeter wsloibe ssbe to syslog. Foriexample, s t ang the followien: man blockquota> pray=>".rr,code">syslog = 3stara> /blockquota>

    spocicoes tha anyploggien messages with a level of 2 or below wslo be ssbe to both syslog andpoueoSae l loggien fites. (The mappings to nsmy=>".rr,f.leassa">syslogstemn prioribies are described in oueoupcomang s cbiam "syslog.") To con anuoioue example, let's assumspthat we uave set the ny t=>".rr,lonfbal">logsttt>dny t=>".rr,lonfbal">levelsttt> opbiam to 4. Loggien messages with levels of 2 and 1 wsloibe ssbe to both syslog andpoue Sae l loggien fites, and messages with a level of 3 or 4 wsloibe ssbe to the Sae l loggien fites, but not to syslog. If the ny t=>".rr,lonfbal">syslogsttt> valuepexceadsithe ny t=>".rr,lonfbal">logsttt> y t=>".rr,lonfbal">levelsttt> value, notuingiwsloibe ssbe to syslog. man p>If you wan" oo spocicy that messages be ssbe only oo syslog—and not to the standerd Sae l loggien fites—you can place ouis optiam in tue configurataam fite: man blockquota> pray=>".rr,code">syslog only =dyesstara> /blockquota>

    If this is oue case,panyploggien in>ormatiam aboeoioue numbar spocicoedpin theony t=>".rr,lonfbal">syslogsttt> optiam wsloibe discarded, as wsth oue ny t=>".rr,lonfbal">logsttt>dny t=>".rr,lonfbal">levelsttt> opbiam. man htdiv> hdivcond dirsecb2"> t assas"she l2-CHP-6-SECT-8.2"/> nh3cond dirhead2">Loggien Configurataam Opbiamssth3n p>nt hdd>s"ch06.html#she l2-CHP-6-TABLE-8">Ta te 6-8 lis"s eat> loggien configurataam opbiam that Sae l can use. man t assas"she l2-CHP-6-TABLE-8"/>Ta te 6-8. Loggien configurataam opbiamssth4>

    ntr> nyh>

    Optoamstan /yh>

    Pdrsmetersstan /yh>

    Funcbiamstan /yh>

    Defaacrstan /yh>

    Scopestan /yh> ntr> nyd>

    ny t=>".rr,lonfbal">log fitesttt>stan /yd> nyd>

    string (assa of fite)stan /yd> nyd>

    Nssa of the log fite that Sae l is to use. Works with aloivaria tes.nman /yd> nyd>

    Spocicoedpin Sae l makefitestan /yd> nyd>

    Globalstan /yd> n/tr> nyr> nyd>

    ny t=>".rr,lonfbal">log levelsttt> man p>ny t=>".rr,lonfbal">(debunplevel)sttt>stan /yd> nyd>

    numeric (0-10)stan /yd> nyd>

    Amoube of log/debunpmessages that eri ssbe to the log fite. 0 is none; 3 isdconsidera te.nman /yd> nyd>

    ny t=>".rr,lonfbal">1sttt>nman /yd> nyd>

    Globalstan /yd> n/tr> nyr> nyd>

    ny t=>".rr,lonfbal">max log sizisttt>stan /yd> nyd>

    numeric (sizi in KB)stan /yd> nyd>

    Maximum sizi of log fite.nman /yd> nyd>

    ny t=>".rr,lonfbal">5000sttt>nman /yd> nyd>

    Globalstan /yd> n/tr> nyr> nyd>

    ny t=>".rr,lonfbal">debunptisastampsttt>dny t=>".rr,lonfbal">(tisastamp logs)sttt>stan /yd> nyd>

    booleanstan /yd> nyd>

    Ifpny t=>".rr,lonfbal">nosttt>, doesn't tisastamp logs, makien oueL easiou to riad durang heavy debungien.nman /yd> nyd>

    ny t=>".rr,lonfbal">yessttt>stan /yd> nyd>

    Globalstan /yd> n/tr> nyr> nyd>

    ny t=>".rr,lonfbal">syslogsttt>stan /yd> nyd>

    numeric (0-10)stan /yd> nyd>

    Level of messages ssbe to nsmy=>".rr,atShah b">syslogstemn.aTuose/levels below ny t=>".rr,lonfbal">syslogsttt> ny t=>".rr,lonfbal">levelsttt> wsloibe ssbe to the systeL logger.nman /yd> nyd>

    ny t=>".rr,lonfbal">1sttt>nman /yd> nyd>

    Globalstan /yd> n/tr> nyr> nyd>

    ny t=>".rr,lonfbal">syslog onlysttt>stan /yd> nyd>

    booleanstan /yd> nyd>

    Ifpny t=>".rr,lonfbal">yessttt>, uses nsmy=>".rr,atShah b">syslogstemn entirely and ssbds no output to the Sae l log fites.nman /yd> nyd>

    ny t=>".rr,lonfbal">nosttt>nman /yd> nyd>

    Globalstan /yd> n/tr> n/tablen hdivcond dirsecb3"> t assas"she l2-CHP-6-SECT-8.2.1"/> nh3cond dirhead3">log fitesth3n p>By defaacr, Sae lowripes log in>ormatiam to text fites in ui nsmy=>".rr,f.leassa">/usr/local/she l/varstemn diris ory. The ny t=>".rr,lonfbal">logsttt> t assas"INDEX-98"/n y t=>".rr,lonfbal">f.lesttt> opbiam can be usad to set the nssa of the log fite to anot e: loca aam. For example, to put the Sae l log in>ormatiam in nsmy=>".rr,f.leassa">/usr/local/logs/she l.logstemn, you could use oue followien: man blockquota> pray=>".rr,code">[global] log fite = /usr/local/logs/she l.logstara> /blockquota>

    You can use varia te subseitutaam to crrate log fites spocicocally for individual useuspor clisbes. man p>You can override/the defaacralog fite locatiam usien oue nsmy=>".rr,atShah b">-lstemn command-line swstch wuen eithe: daemon is started.aHowever, this does not override/the ny t=>".rr,lonfbal">logsttt> y t=>".rr,lonfbal">f.lesttt> opbiam. If you do spocicy this pdrsmeter, initaal loggien in>ormatiam wsloibe ssbe to the fileospocicoedplfter nsmy=>".rr,atShah b">-lstemn (orioueodefaacraspocicoedpin theoSae l makefite) ubeil tue daemons have processed ui nsmy=>".rr,f.leassa">smb.confstemn fite and know to ridiris ait to a new log fite.nman htdiv> hdivcond dirsecb3"> t assas"she l2-CHP-6-SECT-8.2.2"/> nh3cond dirhead3">log levelsth3n p>The ny t=>".rr,lonfbal">logsttt> t assas"INDEX-99"/n y t=>".rr,lonfbal">levelsttt> opbiam s tsNthe amoube of data to be logged.aNormally this is s t top0por 1. However, if you uave a spocicoc pro tem, you might wan" oo se ait at 3, whtt> provides oue mo=" useful debungien in>ormatiam you would nead oo track down a pro tem. Levels aboeoi3iprovide in>ormatiam that's primarily for oueodevelopers to use for chah en innfbn,lpbuns, and it slows down the s Seou considera ty. Thedd>ore, we ricommendpouat for normal day-to-day operataam, you evoid s t ang this opbiam to anytuingiaboeoi3.nman htdiv> hdivcond dirsecb3"> t assas"she l2-CHP-6-SECT-8.2.3"/> nh3cond dirhead3">max log sizisth3n p>The ny t=>".rr,lonfbal">maxsttt> t assas"INDEX-100"/n y t=>".rr,lonfbal">logsttt> y t=>".rr,lonfbal">sizisttt> opbiam s tsNthe maximum sizi,pin kilobytas, of the debungien log fite that Sae l keeps. When the log fite exceads this sizi, oueocurrent log fite is riassad to add a smy=>".rr,f.leassa">.oldstemn extensiam (fbasang any previous fite wsth that assa)Nand ainew debungien log fite is started wsth oue origin,l assa. Foriexample: man blockquota> pray=>".rr,code">[global] log fite = /usr/local/logs/she l.log.%m max log sizi = 1000stara> /blockquota>

    Here, if the sizi of anyplog fite exceadsi1MB, Sae l renssas the log fileonsmy=>".rr,atShah b">she l.logstemn. smy=>".rr,replacea te">macuine-nssastemn smy=>".rr,atShah b">.oldstemn, and ainew log fite is genera ed. If there is already a fite wsth the nsmy=>".rr,atShah b">.oldstemn extensiam, Sae l deletas it. We highly ricommendps t ang this opbiam in youraconfigurataam fitesobecause debunploggien (even/at lowe: levels) can quie ly eat eway at your available disk space. Usien ouis opbiam protes s unwary ldminis"rators from suddenly discoverien ouat most of the space on a disk oripdrtibionphas been/swallowed uppby a sienle Sae l log fite.nman htdiv> hdivcond dirsecb3"> t assas"she l2-CHP-6-SECT-8.2.4"/> nh3cond dirhead3">debunptisastamp or oisastamp logssth3n p>If you happen to be debungien a network pro tem andNyou find that the tisastamp in>ormatiam within theoSae l log lines g tsNin theoway, you can turn it offpby givien eithe: oue ny t=>".rr,lonfbal">tisastampsttt> t assas"INDEX-101"/n y t=>".rr,lonfbal">logssttt> o: oue synonymous ny t=>".rr,lonfbal">debunsttt> t assas"INDEX-102"/> y t=>".rr,lonfbal">tisastampsttt>dopbiam a valuepofiny t=>".rr,lonfbal">nosttt>. Foriexample, l regular Sae l log fite pre.ebes its output in ui followiena>orm: man blockquota> pray=>".rr,code">12/31/01 12:03:34 toltes (172.16.1.1)iconnecb to s Seou network as useu jaystara> /blockquota>

    With a ny t=>".rr,lonfbal">nosttt>avaluepforiouis opbiam, oue output would appear withoutithe tisastamp: man blockquota> pray=>".rr,code">toltes (172.16.1.1)iconnecb to s Seou network as useu jaystara> /blockquota> htdiv> hdivcond dirsecb3"> t assas"she l2-CHP-6-SECT-8.2.5"/> nh3cond dirhead3">syslogsth3n p>Theony t=>".rr,lonfbal">syslogsttt> t assas"INDEX-103"/n opbiam causes Sae l log messages oo be ssbe to the UnixasysteL logger. The typi of log in>ormatiam to be ssbe is spocicoed as a numeric value.aLike the ny t=>".rr,lonfbal">logsttt>dny t=>".rr,lonfbal">levelsttt> opbiam, it can be a numbar from 0 to 10. Loggien in>ormatiam with a level less ouan ui numbar spocicoedpwsloibe ssbe to the systeL logger. Debunplogs grrate: han oriequ,l to oue ny t=>".rr,lonfbal">syslogsttt> level, but less ouan log level, wsloistsloibe ssbe to the standerd Sae l log fites. Foriexample: man blockquota> pray=>".rr,code">[global] log level = 3 syslog = 1stara> /blockquota>

    With ouis, lll loggien in>ormatiam with a level of 0 would be ssbe to the standerd Sae l logs andpoueosysteL logger, whtle in>ormatiam with levels 1, 2, and 3 would be ssbe only oo the standerd Sae l logs. Levels aboeoi3iare nob logged ae lll. All messages ssbe to oueosysteL logger eri mapped to a prioriby level that the syslogd daemon understands,pls shown in nt hdd>s"ch06.html#she l2-CHP-6-TABLE-9">Ta te 6-9. The defaacr level is 1. man t assas"she l2-CHP-6-TABLE-9"/>Ta te 6-9. syslog prioriby coneousiamsth4>

    ntr> nyh>

    Log levelstan /yh>

    syslog prioribystan /yh> ntr> nyd>

    0nman /yd> nyd>

    ny t=>".rr,lonfbal">LOG_ERRsttt>nman /yd> n/tr> nyr> nyd>

    1nman /yd> nyd>

    ny t=>".rr,lonfbal">LOG_WARNING mtt>nman /yd> n/tr> nyr> nyd>

    2nman /yd> nyd>

    ny t=>".rr,lonfbal">LOG_NOTICE mtt>nman /yd> n/tr> nyr> nyd>

    3nman /yd> nyd>

    ny t=>".rr,lonfbal">LOG_INFO mtt>nman /yd> n/tr> nyr> nyd>

    4Nand aboeonman /yd> nyd>

    ny t=>".rr,lonfbal">LOG_DEBUG mtt>nman /yd> n/tr> n/tablen p>If you wishpto use nsmy=>".rr,atShah b">syslogstemn,iyou wiloiuave to run y t=>".rr,lonfbal">configuresttt> y t=>".rr,lonfbal">--wsth-syslogsttt> when compiling Sae l, andNyou wiloinead oo configure your nsmy=>".rr,f.leassa">/etc/syslog.confstemn to suit. (See nt hdd>s"ch06.html#she l2-CHP-6-SECT-8.1">S cbiam 6.8.1, earlisr in ouis chapter.)nman htdiv> hdivcond dirsecb3"> t assas"she l2-CHP-6-SECT-8.2.6"/> nh3cond dirhead3">syslog onlysth3n p>The ny t=>".rr,lonfbal">syslogsttt> t assas"INDEX-104"/n y t=>".rr,lonfbal">onlysttt> opbiam tells Sae l not to use its own loggien fites ae lll andpoo u.e only the systeL logger. To enabte tuis, spocicy the followienaopbiam in oueoglobal s cbiam of tue Sae l configurataam fite: man t assas"INDEX-105"/nnt assas"INDEX-106"/nnt assas"INDEX-107"/nnblockquota> pray=>".rr,code">[global] syslog only =dyesstara> /blockquota> htdiv> htdiv> htdiv>


    Footnotassth4> t assas"FOOTNOTE-1"/n p>nt hdd>s"#FNPTR-1">[1] Depsbdienaon yourasysteL, this fileomight not be nsmy=>".rr,atShah b">/etc/prinpcapstemn.aYou can use the nsmy=>".rr,atShah b">tastpdrmstemn command that comes with Sae loto dump oueopdrsmeter definitaons andNdetermine the valuepofithe y t=>".rr,lonfbal">prinpcapsttt> y t=>".rr,lonfbal">nssasttt> configurataam opbiam. The valuep".rignad oo it isioueodefaacravaluepcuosenpwhen Sae l was configured andNcompiled, whtt> should be corris .nman t assas"FOOTNOTE-2"/n p>nt hdd>s"#FNPTR-2">[2] We are riferrien here oo oueowsndow ouat opsbs wuen a prinped icam in tue Prinpeds con rolopdnel is doubte-clicked.nman /blockquota>
    nt hdd>s"toc.html">TOCsth4>sthtml>